Skip to content

Commit

Permalink
[CIFS] Fix oops when negotiating lanman and no password specified
Browse files Browse the repository at this point in the history
Pointed out by Guenter Kukkukk

Signed-of-by: Steve French <sfrench@us.ibm.com>
(cherry picked from bbf33d512da608c7221fec42b56b9ef89c25a5ee commit)
  • Loading branch information
Steve French committed Aug 11, 2006
1 parent 7ee1af7 commit 66abda5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/cifs/cifsencrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ void calc_lanman_hash(struct cifsSesInfo * ses, char * lnm_session_key)
return;

memset(password_with_pad, 0, CIFS_ENCPWD_SIZE);
strncpy(password_with_pad, ses->password, CIFS_ENCPWD_SIZE);
if(ses->password)
strncpy(password_with_pad, ses->password, CIFS_ENCPWD_SIZE);

if((ses->server->secMode & SECMODE_PW_ENCRYPT) == 0)
if(extended_security & CIFSSEC_MAY_PLNTXT) {
Expand Down

0 comments on commit 66abda5

Please sign in to comment.