From a901c5768accd49b40b17b3350613ca7819a2854 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Thu, 11 Jul 2019 11:28:58 +0000 Subject: [PATCH] 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 --- libcli/cldap/cldap.c | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.47.3