From: Noel Power Date: Thu, 11 Jul 2019 11:28:58 +0000 (+0000) Subject: libcli/cldap: clang: Fix 'Dereference of null pointer' X-Git-Tag: talloc-2.3.0~82 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a901c5768accd49b40b17b3350613ca7819a2854;p=thirdparty%2Fsamba.git libcli/cldap: clang: Fix 'Dereference of null pointer' Fixes: libcli/cldap/cldap.c:144:8: warning: Dereference of null pointer <--[clang] ev = c->searches.list->caller.ev; ^ 1 warning generated. Signed-off-by: Noel Power Reviewed-by: Gary Lockyer --- diff --git a/libcli/cldap/cldap.c b/libcli/cldap/cldap.c index daba37a21d7..f609bf278e4 100644 --- a/libcli/cldap/cldap.c +++ b/libcli/cldap/cldap.c @@ -141,6 +141,10 @@ static bool cldap_recvfrom_setup(struct cldap_socket *c) ev = c->incoming.ev; if (ev == NULL) { + /* this shouldn't happen but should be protected against */ + if (c->searches.list == NULL) { + return false; + } ev = c->searches.list->caller.ev; }