mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
smb: fix invalid username check in smb3_fs_context_parse_param()
Since the maximum return value of strnlen(..., CIFS_MAX_USERNAME_LEN) is CIFS_MAX_USERNAME_LEN, length check in smb3_fs_context_parse_param() is always FALSE and invalid. Fix the comparison in if statement. Signed-off-by: Yiqi Sun <sunyiqixm@gmail.com> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
@@ -1470,7 +1470,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
|
||||
break;
|
||||
}
|
||||
|
||||
if (strnlen(param->string, CIFS_MAX_USERNAME_LEN) >
|
||||
if (strnlen(param->string, CIFS_MAX_USERNAME_LEN) ==
|
||||
CIFS_MAX_USERNAME_LEN) {
|
||||
pr_warn("username too long\n");
|
||||
goto cifs_parse_mount_err;
|
||||
|
||||
Reference in New Issue
Block a user