From 40ddcf7bdcec547acdba090f43651cc5b953aded Mon Sep 17 00:00:00 2001 From: Noel Power Date: Thu, 8 Aug 2019 13:12:39 +0000 Subject: [PATCH] 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 --- source3/libads/cldap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.3