Commit 12c43a06 authored by ZhangGuoDong's avatar ZhangGuoDong Committed by Steve French
Browse files

smb/client: fix buffer size for smb311_posix_qinfo in smb2_compound_op()



Use `sizeof(struct smb311_posix_qinfo)` instead of sizeof its pointer,
so the allocated buffer matches the actual struct size.

Fixes: 6a5f6592 ("SMB311: Add support for query info using posix extensions (level 100)")
Reported-by: default avatarChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: default avatarZhangGuoDong <zhangguodong@kylinos.cn>
Reviewed-by: default avatarChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 6f040253
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -325,7 +325,7 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
							  cfile->fid.volatile_fid,
							  SMB_FIND_FILE_POSIX_INFO,
							  SMB2_O_INFO_FILE, 0,
							  sizeof(struct smb311_posix_qinfo *) +
							  sizeof(struct smb311_posix_qinfo) +
							  (PATH_MAX * 2) +
							  (sizeof(struct smb_sid) * 2), 0, NULL);
			} else {
@@ -335,7 +335,7 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
							  COMPOUND_FID,
							  SMB_FIND_FILE_POSIX_INFO,
							  SMB2_O_INFO_FILE, 0,
							  sizeof(struct smb311_posix_qinfo *) +
							  sizeof(struct smb311_posix_qinfo) +
							  (PATH_MAX * 2) +
							  (sizeof(struct smb_sid) * 2), 0, NULL);
			}