From: Andrew Tridgell Date: Wed, 24 Sep 2008 03:01:06 +0000 (-0700) Subject: stricter checking of SMB2 echo body (per the spec) X-Git-Tag: samba-4.0.0alpha6~769^2~228^2~183 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff542275c3e2bf432bcc303e95124374ada03675;p=thirdparty%2Fsamba.git stricter checking of SMB2 echo body (per the spec) thanks to the bluearc test suite --- diff --git a/source4/smb_server/smb2/keepalive.c b/source4/smb_server/smb2/keepalive.c index f40bcc485c5..d1a0ef3d722 100644 --- a/source4/smb_server/smb2/keepalive.c +++ b/source4/smb_server/smb2/keepalive.c @@ -54,11 +54,16 @@ void smb2srv_keepalive_recv(struct smb2srv_request *req) { uint16_t _pad; - if (req->in.body_size < 0x04) { + if (req->in.body_size != 0x04) { smb2srv_send_error(req, NT_STATUS_FOOBAR); return; } + if (SVAL(req->in.body, 0x00) != 0x04) { + smb2srv_send_error(req, NT_STATUS_INVALID_PARAMETER); + return; + } + _pad = SVAL(req->in.body, 0x02); req->status = smb2srv_keepalive_backend(req);