diff options
author | Jeremy Allison <jra@samba.org> | 2002-08-28 12:45:19 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-08-28 12:45:19 +0000 |
commit | 3a21fa3bb96e4d4ba5410435fdc6178c591db8c1 (patch) | |
tree | ad6da5243a9d8359e80a52a35f7eb9f662e9705d | |
parent | d1e68f2ad401c5bcef4a5452e0d836b601651bab (diff) | |
download | samba-3a21fa3bb96e4d4ba5410435fdc6178c591db8c1.tar.gz samba-3a21fa3bb96e4d4ba5410435fdc6178c591db8c1.tar.bz2 samba-3a21fa3bb96e4d4ba5410435fdc6178c591db8c1.zip |
Move -4 to correct side of comparison.
Jeremy.
(This used to be commit d825026658b59364f9adc425bca4017be8e979e2)
-rw-r--r-- | source3/smbd/process.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 6b9e184afe..2c35eadb18 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -653,8 +653,8 @@ static int switch_message(int type,char *inbuf,char *outbuf,int size,int bufsize errno = 0; last_message = type; - /* Make sure this is an SMB packet */ - if ((strncmp(smb_base(inbuf),"\377SMB",4) != 0) || (size - 4 < smb_size)) { + /* Make sure this is an SMB packet. smb_size contains NetBIOS header so subtract 4 from it. */ + if ((strncmp(smb_base(inbuf),"\377SMB",4) != 0) || (size < (smb_size - 4))) { DEBUG(2,("Non-SMB packet of length %d. Terminating server\n",smb_len(inbuf))); exit_server("Non-SMB packet"); return(-1); |