diff options
author | Steve French <sfrench@us.ibm.com> | 2006-08-11 12:52:09 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2006-08-11 17:29:13 -0400 |
commit | 66abda5e1fa48e12e06d0b68746b0e67202a97d2 (patch) | |
tree | 5ca65be63b9c3b24548a190d8fcf04653a6ec451 /fs | |
parent | 7ee1af765dfa3146aef958258003245e082284e5 (diff) |
[CIFS] Fix oops when negotiating lanman and no password specified
Pointed out by Guenter Kukkukk
Signed-of-by: Steve French <sfrench@us.ibm.com>
(cherry picked from bbf33d512da608c7221fec42b56b9ef89c25a5ee commit)
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifsencrypt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index a89efaf78a26..4bc250b2d9fc 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c | |||
@@ -277,7 +277,8 @@ void calc_lanman_hash(struct cifsSesInfo * ses, char * lnm_session_key) | |||
277 | return; | 277 | return; |
278 | 278 | ||
279 | memset(password_with_pad, 0, CIFS_ENCPWD_SIZE); | 279 | memset(password_with_pad, 0, CIFS_ENCPWD_SIZE); |
280 | strncpy(password_with_pad, ses->password, CIFS_ENCPWD_SIZE); | 280 | if(ses->password) |
281 | strncpy(password_with_pad, ses->password, CIFS_ENCPWD_SIZE); | ||
281 | 282 | ||
282 | if((ses->server->secMode & SECMODE_PW_ENCRYPT) == 0) | 283 | if((ses->server->secMode & SECMODE_PW_ENCRYPT) == 0) |
283 | if(extended_security & CIFSSEC_MAY_PLNTXT) { | 284 | if(extended_security & CIFSSEC_MAY_PLNTXT) { |