summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2016-06-22 09:25:16 +0200
committerJeremy Allison <jra@samba.org>2016-06-22 19:25:20 +0200
commit7bac35e7fd6d2e580648e0028e114626edf3dc2e (patch)
tree695c0ba534f90b165e29e9d9b75f063e2948b2a8 /source4/librpc
parent8e88ab727a68eb3979ad1bde65001130c7166d1f (diff)
downloadsamba-7bac35e7fd6d2e580648e0028e114626edf3dc2e.tar.gz
librpc: Check for negative return value of socket_get_fd()
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/rpc/dcerpc_sock.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c
index f5a1c07c922..7175eb2e367 100644
--- a/source4/librpc/rpc/dcerpc_sock.c
+++ b/source4/librpc/rpc/dcerpc_sock.c
@@ -72,6 +72,11 @@ static void continue_socket_connect(struct composite_context *ctx)
return;
}
sock_fd = socket_get_fd(s->socket_ctx);
+ if (sock_fd == -1) {
+ TALLOC_FREE(s->socket_ctx);
+ composite_error(c, NT_STATUS_INVALID_HANDLE);
+ return;
+ }
socket_set_flags(s->socket_ctx, SOCKET_FLAG_NOCLOSE);
TALLOC_FREE(s->socket_ctx);