aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-08-23 11:38:04 -0400
committerSteve French <sfrench@us.ibm.com>2010-08-23 13:38:31 -0400
commit24e6cf92fde1f140d8eb0bf7cd24c2c78149b6b2 (patch)
tree62ead9abea45977c5c9086284611bcb74f844aa2 /fs
parent3ec6bbcdb4e85403f2c5958876ca9492afdf4031 (diff)
cifs: check for NULL session password
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 <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/connect.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 18af707f00f1..ec0ea4a43bdb 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1673,6 +1673,7 @@ cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol)
1673 MAX_USERNAME_SIZE)) 1673 MAX_USERNAME_SIZE))
1674 continue; 1674 continue;
1675 if (strlen(vol->username) != 0 && 1675 if (strlen(vol->username) != 0 &&
1676 ses->password != NULL &&
1676 strncmp(ses->password, 1677 strncmp(ses->password,
1677 vol->password ? vol->password : "", 1678 vol->password ? vol->password : "",
1678 MAX_PASSWORD_SIZE)) 1679 MAX_PASSWORD_SIZE))