diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-08-14 11:14:42 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-08-14 13:27:49 +0200 |
commit | 86ea1c4d24c80ada573fe6f91ea56c1bace2f906 (patch) | |
tree | 38721cc34c8278ec0746c3d53e22ebd9b9ed7bc3 /source3/smbd | |
parent | 53ef426e6f68728763436bd0cd3dd91180c00579 (diff) | |
download | samba-86ea1c4d24c80ada573fe6f91ea56c1bace2f906.tar.gz samba-86ea1c4d24c80ada573fe6f91ea56c1bace2f906.tar.bz2 samba-86ea1c4d24c80ada573fe6f91ea56c1bace2f906.zip |
s3:smbd: fix parsing of the SMB2 body
Maybe there's no dynamic part on the wire.
metze
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/smb2_server.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 1b22c82724..f4605ddde9 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -1328,7 +1328,13 @@ static int smbd_smb2_request_next_vector(struct tstream_context *stream, * body and let the caller deal with the error */ invalid = true; - } else if (body_size > (full_size - SMB2_HDR_BODY)) { + } + + if ((body_size % 2) != 0) { + body_size -= 1; + } + + if (body_size > (full_size - SMB2_HDR_BODY)) { /* * this is invalid, just return a zero * body and let the caller deal with the error @@ -1342,10 +1348,6 @@ static int smbd_smb2_request_next_vector(struct tstream_context *stream, body_size = 2; } - if ((body_size % 2) != 0) { - body_size -= 1; - } - dyn_size = full_size - (SMB2_HDR_BODY + body_size); state->missing -= (body_size - 2) + dyn_size; |