提交 fc87a406 编写于 作者: J Jeff Layton 提交者: Steve French

cifs: fix NULL pointer dereference in cifs_find_smb_ses

cifs_find_smb_ses assumes that the vol->password field is a valid
pointer, but that's only the case if a password was passed in via
the options string. It's possible that one won't be if there is
no mount helper on the box.
Reported-by: Ndiabel <gacek-2004@wp.pl>
Signed-off-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 232341ba
......@@ -1673,7 +1673,8 @@ cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol)
MAX_USERNAME_SIZE))
continue;
if (strlen(vol->username) != 0 &&
strncmp(ses->password, vol->password,
strncmp(ses->password,
vol->password ? vol->password : "",
MAX_PASSWORD_SIZE))
continue;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册