1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-30 06:50:24 +03:00

s3: Check for the packet size before accessing it

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jan  4 15:16:20 CET 2012 on sn-devel-104
This commit is contained in:
Volker Lendecke 2012-01-03 22:19:27 +01:00 committed by Jeremy Allison
parent bf0da0b4f7
commit 69a67a1b73

View File

@ -1409,8 +1409,7 @@ 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(sconn, req->inbuf)
|| (size < (smb_size - 4))) {
if ((size < (smb_size - 4)) || !valid_smb_header(sconn, req->inbuf)) {
DEBUG(2,("Non-SMB packet of length %d. Terminating server\n",
smb_len(req->inbuf)));
exit_server_cleanly("Non-SMB packet");