Skip to content
Snippets Groups Projects
Commit 24e6cf92 authored by Jeff Layton's avatar Jeff Layton Committed by Steve French
Browse files

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: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 3ec6bbcd
No related branches found
No related tags found
No related merge requests found
...@@ -1673,6 +1673,7 @@ cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol) ...@@ -1673,6 +1673,7 @@ cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol)
MAX_USERNAME_SIZE)) MAX_USERNAME_SIZE))
continue; continue;
if (strlen(vol->username) != 0 && if (strlen(vol->username) != 0 &&
ses->password != NULL &&
strncmp(ses->password, strncmp(ses->password,
vol->password ? vol->password : "", vol->password ? vol->password : "",
MAX_PASSWORD_SIZE)) MAX_PASSWORD_SIZE))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment