1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

Move -4 to correct side of comparison.

Jeremy.
This commit is contained in:
Jeremy Allison -
parent 64e5287b06
commit d825026658

View File

@ -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);