1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

r11752: setup the dynamic pointer for incoming packets too

(This used to be commit 583f3c415ea33ddf5f4065a66f6fae49ab48455e)
This commit is contained in:
Andrew Tridgell 2005-11-17 00:48:24 +00:00 committed by Gerald (Jerry) Carter
parent 1c71db99aa
commit 94ae534128
2 changed files with 15 additions and 1 deletions

View File

@ -138,7 +138,7 @@ struct smb2_request {
};
#define SMB2_MIN_SIZE 0x40
#define SMB2_MIN_SIZE 0x42
/* offsets into header elements */
#define SMB2_HDR_LENGTH 0x04

View File

@ -148,6 +148,8 @@ static NTSTATUS smb2_transport_finish_recv(void *private, DATA_BLOB blob)
int len;
struct smb2_request *req = NULL;
uint64_t seqnum;
uint16_t buffer_code;
uint32_t dynamic_size;
buffer = blob.data;
len = blob.length;
@ -183,6 +185,18 @@ static NTSTATUS smb2_transport_finish_recv(void *private, DATA_BLOB blob)
req->in.body_size = req->in.size - (SMB2_HDR_BODY+NBT_HDR_SIZE);
req->status = NT_STATUS(IVAL(hdr, SMB2_HDR_STATUS));
buffer_code = SVAL(req->in.body, 0);
req->in.dynamic = NULL;
dynamic_size = req->in.body_size - (buffer_code & ~1);
if (dynamic_size != 0 && (buffer_code & 1)) {
req->in.dynamic = req->in.body + (buffer_code & ~1);
if (smb2_oob(&req->in, req->in.dynamic, dynamic_size)) {
DEBUG(1,("SMB2 request invalid dynamic size 0x%x\n",
dynamic_size));
goto error;
}
}
DEBUG(2, ("SMB2 RECV seqnum=0x%llx\n", req->seqnum));
dump_data(5, req->in.body, req->in.body_size);