cifs: check for NULL session password
authorJeff Layton <jlayton@redhat.com>
Mon, 23 Aug 2010 15:38:04 +0000 (11:38 -0400)
committerSteve French <sfrench@us.ibm.com>
Mon, 23 Aug 2010 17:38:31 +0000 (17:38 +0000)
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>
fs/cifs/connect.c

index 18af707f00f1ff002c4362140453af6481f745c7..ec0ea4a43bdb4efc0f3734f439b6af78af97a2f4 100644 (file)
@@ -1673,6 +1673,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))