Skip to content

Commit 24e6cf9

Browse files
jtlaytonSteve French
authored andcommitted
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>
1 parent 3ec6bbc commit 24e6cf9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/cifs/connect.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,6 +1673,7 @@ cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol)
16731673
MAX_USERNAME_SIZE))
16741674
continue;
16751675
if (strlen(vol->username) != 0 &&
1676+
ses->password != NULL &&
16761677
strncmp(ses->password,
16771678
vol->password ? vol->password : "",
16781679
MAX_PASSWORD_SIZE))

0 commit comments

Comments
 (0)