From: Volker Lendecke Date: Sun, 19 Oct 2008 12:50:55 +0000 (+0200) Subject: Use a direct compare instead of calling strncmp in valid_smb_header X-Git-Tag: samba-4.0.0alpha6~778^2~19^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1510b7b8c99ea64a8fabdb89c5868b2f5895fdbf;p=thirdparty%2Fsamba.git Use a direct compare instead of calling strncmp in valid_smb_header --- diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 7b0d14968aa..c74c7fd445d 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -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. */