summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/process.c4
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);