Fix failures setting a random password
authorAndrew Bartlett <abartlet@samba.org>
Thu, 18 Dec 2008 21:18:57 +0000 (08:18 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 18 Dec 2008 21:18:57 +0000 (08:18 +1100)
The test in extract_pw_from_buffer was incorrect: It tested if the
first byte of the new password was 0 (a 1/256 chance for the random
passwords), not if the password was allocated.

Andrew Bartlett

source4/libcli/auth/smbencrypt.c

index b902dddb0f7f328a35d3bd4b6fc88267c76a076b..bbb363e0dd42019f42b8c5f0fba2d476a3f47200 100644 (file)
@@ -585,7 +585,7 @@ bool extract_pw_from_buffer(TALLOC_CTX *mem_ctx,
 
        *new_pass = data_blob_talloc(mem_ctx, &in_buffer[512 - byte_len], byte_len);
 
-       if (!*new_pass->data) {
+       if (!new_pass->data) {
                return false;
        }