From: Noel Power Date: Thu, 8 Aug 2019 13:12:39 +0000 (+0000) Subject: s3/libads: clang: Fix Array access results in a null pointer dereference X-Git-Tag: talloc-2.3.1~680 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=40ddcf7bdcec547acdba090f43651cc5b953aded;p=thirdparty%2Fsamba.git s3/libads: clang: Fix Array access results in a null pointer dereference Fixes: source3/libads/cldap.c:400:6: warning: Array access (from variable 'responses') results in a null pointer dereference <--[clang] if (responses[0] == NULL) { ^ 1 warning generated. Signed-off-by: Noel Power Reviewed-by: Andreas Schneider --- diff --git a/source3/libads/cldap.c b/source3/libads/cldap.c index f4022a19905..c44201ab8b5 100644 --- a/source3/libads/cldap.c +++ b/source3/libads/cldap.c @@ -397,7 +397,7 @@ bool ads_cldap_netlogon(TALLOC_CTX *mem_ctx, "failed: %s\n", nt_errstr(status))); return false; } - if (responses[0] == NULL) { + if (responses == NULL || responses[0] == NULL) { DEBUG(2, ("ads_cldap_netlogon: did not get a reply\n")); TALLOC_FREE(responses); return false;