diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-09-24 17:34:04 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-09-24 18:10:23 -0700 |
commit | 49c80cea0bc00a88336fc9bd4bb332a7a399afd5 (patch) | |
tree | 7a82a22796333da028efe674169f98b88cdb3b56 | |
parent | a3536c4c06d9725b2e96b9a3ddc1ab14e47f472c (diff) | |
download | samba-49c80cea0bc00a88336fc9bd4bb332a7a399afd5.tar.gz samba-49c80cea0bc00a88336fc9bd4bb332a7a399afd5.tar.bz2 samba-49c80cea0bc00a88336fc9bd4bb332a7a399afd5.zip |
cope with body_size zero in SMB2 receive
-rw-r--r-- | source4/smb_server/smb2/smb2_server.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index d45e0861af..431add4ed9 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -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)); \ |