]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
cifs: check for NULL session password
authorJeff Layton <jlayton@redhat.com>
Mon, 23 Aug 2010 15:38:04 +0000 (11:38 -0400)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 17 May 2012 15:21:23 +0000 (11:21 -0400)
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 <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
fs/cifs/connect.c

index 0fbc8d222a29556f88141c832f2336ddd3844bfe..f31ad2dc43704069fa9b300e6542f9a5e7e3d212 100644 (file)
@@ -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))