1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

cope with body_size zero in SMB2 receive

This commit is contained in:
Andrew Tridgell 2008-09-24 17:34:04 -07:00
parent a3536c4c06
commit 49c80cea0b

View File

@ -75,7 +75,7 @@ struct smbsrv_request;
/* useful way of catching field size errors with file and line number */
#define SMB2SRV_CHECK_BODY_SIZE(req, size, dynamic) do { \
size_t is_size = req->in.body_size; \
uint16_t field_size = SVAL(req->in.body, 0); \
uint16_t field_size; \
uint16_t want_size = ((dynamic)?(size)+1:(size)); \
if (is_size < (size)) { \
DEBUG(0,("%s: buffer too small 0x%x. Expected 0x%x\n", \
@ -83,6 +83,7 @@ struct smbsrv_request;
smb2srv_send_error(req, NT_STATUS_INVALID_PARAMETER); \
return; \
}\
field_size = SVAL(req->in.body, 0); \
if (field_size != want_size) { \
DEBUG(0,("%s: unexpected fixed body size 0x%x. Expected 0x%x\n", \
__location__, (unsigned)field_size, (unsigned)want_size)); \