Ensure convert_string_XXX is always called with a valid converted_size pointer.
[nivanova/samba-autobuild/.git] / libcli / auth / ntlm_check.c
index 9cbd49595f4527086477777e6ae04a4d976f1c7e..9520d32a1e8afa5930aac90c512d52dc628245d4 100644 (file)
@@ -314,6 +314,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
                struct samr_Password client_lm;
                char *unix_pw = NULL;
                bool lm_ok;
+               size_t converted_size = 0;
 
                DEBUG(4,("ntlm_password_check: checking plaintext passwords for user %s\n",
                         username));
@@ -322,7 +323,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
                if (lm_response->length && 
                    (convert_string_talloc(mem_ctx, CH_DOS, CH_UNIX, 
                                          lm_response->data, lm_response->length, 
-                                          (void *)&unix_pw, NULL))) {
+                                          (void *)&unix_pw, &converted_size))) {
                        if (E_deshash(unix_pw, client_lm.hash)) {
                                lm_ok = true;
                        } else {