cifs: check for NULL session password
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- fs/cifs/connect.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
fs/cifs/connect.c +1 -0
@@ -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 ))
Signature · 1 line
1.7.2.1
A message that is not in the archive (sent off-list or not yet received): 1282577884-16564-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Reviewed and merged into cifs-2.6.git
Quoted 16 lines · Jeff Layton
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 <[email protected]>---
fs/cifs/connect.c | 1 +1 files changed, 1 insertions(+), 0 deletions(-)fs/cifs/connect.c +0
-0@@ -1673,6 +1673,7 @@ cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol) MAX_USERNAME_SIZE)) continue;
Quoted 8 lines
if (
strlen(vol->username)!= 0 &&
+ses->password!= NULL &&strncmp(ses->password, vol->password ? vol->password : "", MAX_PASSWORD_SIZE))
--
1.7.2.1
--
Thanks,
Steve