[PATCH] libldap: Fix CID 1308982 Unchecked return value from library

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Jun 30 06:12:00 MDT 2015


Hi!

Review&push appreciated!

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 1b65ce442907beb3997dcc5a31d9b298cd5c7a9b Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Tue, 30 Jun 2015 14:10:50 +0200
Subject: [PATCH] libldap: Fix CID 1308982 Unchecked return value from library

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source4/libcli/ldap/ldap_client.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c
index e49df9e..68ebfcf 100644
--- a/source4/libcli/ldap/ldap_client.c
+++ b/source4/libcli/ldap/ldap_client.c
@@ -514,7 +514,13 @@ static void ldap_connect_got_sock(struct composite_context *ctx,
 	TALLOC_FREE(state->sock);
 
 	smb_set_close_on_exec(fd);
-	set_blocking(fd, false);
+
+	ret = set_blocking(fd, false);
+	if (ret == -1) {
+		NTSTATUS status = map_nt_error_from_unix_common(errno);
+		composite_error(state->ctx, status);
+		return;
+	}
 
 	ret = tstream_bsd_existing_socket(state, fd, &state->raw);
 	if (ret == -1) {
-- 
1.7.9.5



More information about the samba-technical mailing list