mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
Fix bug #8686 - Packet validation checks can be done before length validation causing uninitialized memory read.
(cherry picked from commit 24ac26ddfd
)
This commit is contained in:
parent
9d0ef46101
commit
cc2ba64e21
@ -1442,8 +1442,8 @@ static connection_struct *switch_message(uint8 type, struct smb_request *req, in
|
||||
|
||||
/* Make sure this is an SMB packet. smb_size contains NetBIOS header
|
||||
* so subtract 4 from it. */
|
||||
if (!valid_smb_header(req->inbuf)
|
||||
|| (size < (smb_size - 4))) {
|
||||
if ((size < (smb_size - 4)) ||
|
||||
!valid_smb_header(req->inbuf)) {
|
||||
DEBUG(2,("Non-SMB packet of length %d. Terminating server\n",
|
||||
smb_len(req->inbuf)));
|
||||
exit_server_cleanly("Non-SMB packet");
|
||||
|
Loading…
Reference in New Issue
Block a user