auth: Check for talloc failure in smb_pwd_check_ntlmv2()
authorVolker Lendecke <vl@samba.org>
Fri, 3 Jan 2020 13:04:02 +0000 (14:04 +0100)
committerGary Lockyer <gary@samba.org>
Mon, 6 Jan 2020 01:47:30 +0000 (01:47 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
libcli/auth/ntlm_check.c

index 9f779f85fa16ac0d48c34b8148e5fe9fae7fc120..6e25ca280efceaa8be032a4302998c8adab6151f 100644 (file)
@@ -154,6 +154,10 @@ static bool smb_pwd_check_ntlmv2(TALLOC_CTX *mem_ctx,
        if (memcmp(value_from_encryption, ntv2_response->data, 16) == 0) { 
                if (user_sess_key != NULL) {
                        *user_sess_key = data_blob_talloc(mem_ctx, NULL, 16);
+                       if (user_sess_key->data == NULL) {
+                               DBG_ERR("data_blob_talloc failed\n");
+                               return false;
+                       }
 
                        status = SMBsesskeygen_ntv2(kr,
                                                    value_from_encryption,