mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
ksmbd: Use struct_size() to improve get_file_alternate_info()
Use struct_size() to calculate the output buffer length. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
9852d85ec9
commit
04afb0a3c3
@ -4883,7 +4883,7 @@ static void get_file_alternate_info(struct ksmbd_work *work,
|
||||
spin_unlock(&dentry->d_lock);
|
||||
file_info->FileNameLength = cpu_to_le32(conv_len);
|
||||
rsp->OutputBufferLength =
|
||||
cpu_to_le32(sizeof(struct smb2_file_alt_name_info) + conv_len);
|
||||
cpu_to_le32(struct_size(file_info, FileName, conv_len));
|
||||
}
|
||||
|
||||
static int get_file_stream_info(struct ksmbd_work *work,
|
||||
|
Loading…
Reference in New Issue
Block a user