From: Volker Lendecke Date: Wed, 4 Apr 2018 08:26:14 +0000 (+0200) Subject: credentials: Fix CID 1414796 Explicit null dereferenced X-Git-Tag: talloc-2.1.13~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=90c02ec64d0e3c860f8d6906cf849bdd2c7bcc54;p=thirdparty%2Fsamba.git credentials: Fix CID 1414796 Explicit null dereferenced Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/auth/credentials/credentials_secrets.c b/auth/credentials/credentials_secrets.c index ae1d23b51c1..25c1fddf2ec 100644 --- a/auth/credentials/credentials_secrets.c +++ b/auth/credentials/credentials_secrets.c @@ -106,6 +106,11 @@ static NTSTATUS cli_credentials_set_secrets_lct(struct cli_credentials *cred, } password = ldb_msg_find_attr_as_string(msg, "secret", NULL); + if (password == NULL) { + /* This attribute is mandatory */ + talloc_free(mem_ctx); + return NT_STATUS_NOT_FOUND; + } whenChanged = ldb_msg_find_ldb_val(msg, "whenChanged"); if (!whenChanged || ldb_val_to_time(whenChanged, &lct) != LDB_SUCCESS) {