From 841d2aca23f51685ee63f5030244a3f2f2aa6722 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 27 Jan 2012 13:53:34 +1100 Subject: [PATCH 2/2] s3-libsmb Do not limit read replies to NBT packet sizes With the posix extensions, we can read 16MB at a time, so we need to check the full size of the packet, not the size rounded down to the old NBT limit. Andrew Bartlett --- source3/libsmb/clireadwrite.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c index 1f5f925..c374f45 100644 --- a/source3/libsmb/clireadwrite.c +++ b/source3/libsmb/clireadwrite.c @@ -199,7 +199,7 @@ static void cli_read_andx_done(struct tevent_req *subreq) inbuf = cli_smb_inbuf(subreq); state->buf = (uint8_t *)smb_base(inbuf) + SVAL(vwv+6, 0); - if (trans_oob(smb_len(inbuf), SVAL(vwv+6, 0), state->received) + if (trans_oob(smb_len_large(inbuf), SVAL(vwv+6, 0), state->received) || ((state->received != 0) && (state->buf < bytes))) { DEBUG(5, ("server returned invalid read&x data offset\n")); tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE); -- 1.7.6.5