diff options
author | Volker Lendecke <vl@samba.org> | 2008-10-19 14:50:55 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-10-19 21:51:16 +0200 |
commit | 1510b7b8c99ea64a8fabdb89c5868b2f5895fdbf (patch) | |
tree | 4025e2e0c52ef1da4d5b8d70be5f22817c370a05 | |
parent | ac647d03ac271b0a81b6c8041e2c6b84ada13aca (diff) | |
download | samba-1510b7b8c99ea64a8fabdb89c5868b2f5895fdbf.tar.gz samba-1510b7b8c99ea64a8fabdb89c5868b2f5895fdbf.tar.bz2 samba-1510b7b8c99ea64a8fabdb89c5868b2f5895fdbf.zip |
Use a direct compare instead of calling strncmp in valid_smb_header
-rw-r--r-- | source3/smbd/process.c | 6 |
1 files changed, 5 insertions, 1 deletions
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. */ |