From: Steve French Date: Fri, 11 Aug 2006 16:52:09 +0000 (+0000) Subject: [CIFS] Fix oops when negotiating lanman and no password specified X-Git-Tag: v2.6.18-rc6~58^2~3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66abda5e1fa48e12e06d0b68746b0e67202a97d2;p=linux-2.6 [CIFS] Fix oops when negotiating lanman and no password specified Pointed out by Guenter Kukkukk Signed-of-by: Steve French (cherry picked from bbf33d512da608c7221fec42b56b9ef89c25a5ee commit) --- diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index a89efaf78a..4bc250b2d9 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) 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) {