diff options
author | Volker Lendecke <vl@samba.org> | 2012-01-03 22:19:27 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-01-04 15:16:20 +0100 |
commit | 69a67a1b7358d45f7a75fe8f87f652fc237342f7 (patch) | |
tree | 07da0956bda07068d0ca1367f510c28b42f57f89 | |
parent | bf0da0b4f7fcdc655def21f84619850c0d699c3e (diff) | |
download | samba-69a67a1b7358d45f7a75fe8f87f652fc237342f7.tar.gz samba-69a67a1b7358d45f7a75fe8f87f652fc237342f7.tar.bz2 samba-69a67a1b7358d45f7a75fe8f87f652fc237342f7.zip |
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
-rw-r--r-- | source3/smbd/process.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index c448267781..f366600ab8 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -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"); |