mirror of
https://github.com/torvalds/linux.git
synced 2025-04-12 06:49:52 +00:00
smb: client: Add check for next_buffer in receive_encrypted_standard()
Add check for the return value of cifs_buf_get() and cifs_small_buf_get() in receive_encrypted_standard() to prevent null pointer dereference. Fixes: eec04ea11969 ("smb: client: fix OOB in receive_encrypted_standard()") Cc: stable@vger.kernel.org Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
e9a8cac0bf
commit
860ca5e50f
@ -4965,6 +4965,10 @@ one_more:
|
||||
next_buffer = (char *)cifs_buf_get();
|
||||
else
|
||||
next_buffer = (char *)cifs_small_buf_get();
|
||||
if (!next_buffer) {
|
||||
cifs_server_dbg(VFS, "No memory for (large) SMB response\n");
|
||||
return -1;
|
||||
}
|
||||
memcpy(next_buffer, buf + next_cmd, pdu_length - next_cmd);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user