From: Jeff Layton Date: Mon, 23 Aug 2010 15:38:04 +0000 (-0400) Subject: cifs: check for NULL session password X-Git-Tag: v2.6.34.12~39 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c29d4fb16638de318ac8158a3aa9c6440b32c034;p=karo-tx-linux.git cifs: check for NULL session password commit 24e6cf92fde1f140d8eb0bf7cd24c2c78149b6b2 upstream. It's possible for a cifsSesInfo struct to have a NULL password, so we need to check for that prior to running strncmp on it. Signed-off-by: Jeff Layton Signed-off-by: Steve French Signed-off-by: Paul Gortmaker --- diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 0fbc8d222a29..f31ad2dc4370 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1609,6 +1609,7 @@ cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol) MAX_USERNAME_SIZE)) continue; if (strlen(vol->username) != 0 && + ses->password != NULL && strncmp(ses->password, vol->password ? vol->password : "", MAX_PASSWORD_SIZE))