diff options
Diffstat (limited to 'libcli')
-rw-r--r-- | libcli/auth/smbencrypt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libcli/auth/smbencrypt.c b/libcli/auth/smbencrypt.c index 3274f113c2..abd8ad92a3 100644 --- a/libcli/auth/smbencrypt.c +++ b/libcli/auth/smbencrypt.c @@ -529,7 +529,7 @@ bool SMBNTLMv2encrypt(TALLOC_CTX *mem_ctx, bool encode_pw_buffer(uint8_t buffer[516], const char *password, int string_flags) { uint8_t new_pw[512]; - size_t new_pw_len; + ssize_t new_pw_len; /* the incoming buffer can be any alignment. */ string_flags |= STR_NOALIGN; @@ -537,6 +537,9 @@ bool encode_pw_buffer(uint8_t buffer[516], const char *password, int string_flag new_pw_len = push_string(new_pw, password, sizeof(new_pw), string_flags); + if (new_pw_len == -1) { + return false; + } memcpy(&buffer[512 - new_pw_len], new_pw, new_pw_len); |