]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Use a direct compare instead of calling strncmp in valid_smb_header
authorVolker Lendecke <vl@samba.org>
Sun, 19 Oct 2008 12:50:55 +0000 (14:50 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 19 Oct 2008 19:51:16 +0000 (21:51 +0200)
source3/smbd/process.c

index 7b0d14968aa280b8ea3204c0daff54af49a95e04..c74c7fd445d1cacde309db055e064db776eb42e7 100644 (file)
@@ -105,7 +105,11 @@ static bool valid_smb_header(const uint8_t *inbuf)
        if (is_encrypted_packet(inbuf)) {
                return true;
        }
-       return (strncmp(smb_base(inbuf),"\377SMB",4) == 0);
+       /*
+        * This used to be (strncmp(smb_base(inbuf),"\377SMB",4) == 0)
+        * but it just looks weird to call strncmp for this one.
+        */
+       return (IVAL(smb_base(inbuf), 0) == 0x424D53FF);
 }
 
 /* Socket functions for smbd packet processing. */