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:
parent
a3536c4c06
commit
49c80cea0b
@ -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)); \
|
||||
|
Loading…
x
Reference in New Issue
Block a user