Skip to contentSkip to conversation

cifs: check for NULL session password

PATCH In review Jeff Layton 2 participants 2 messages Aug 23, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

---
 fs/cifs/connect.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
fs/cifs/connect.c +1 -0
index 18af707..ec0ea4a 100644
@@ -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

#2 lore raw

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.

---
 fs/cifs/connect.c |    1 +

 1 files changed, 1 insertions(+), 0 deletions(-)
fs/cifs/connect.c +0 -0
index 18af707..ec0ea4a 100644
@@ -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