From 1510b7b8c99ea64a8fabdb89c5868b2f5895fdbf Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 19 Oct 2008 14:50:55 +0200 Subject: Use a direct compare instead of calling strncmp in valid_smb_header --- source3/smbd/process.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 7b0d14968a..c74c7fd445 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. */ -- cgit