s3-libsmb Do not limit read replies to NBT packet sizes
authorAndrew Bartlett <abartlet@samba.org>
Fri, 27 Jan 2012 00:48:11 +0000 (11:48 +1100)
committerJeremy Allison <jra@samba.org>
Fri, 27 Jan 2012 21:36:06 +0000 (13:36 -0800)
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

Signed-off-by: Jeremy Allison <jra@samba.org>
source3/libsmb/clireadwrite.c

index 2a39edfbe276c255249bb6d71c5c310eddaf1548..8e845ee637eaefb849e0f51138fa1bcbbcd8eec4 100644 (file)
@@ -244,7 +244,7 @@ static void cli_read_andx_done(struct tevent_req *subreq)
 
        state->buf = discard_const_p(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_tcp(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);