diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-26 05:36:14 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:04:45 -0500 |
commit | 84bbf02e95639536c34140906aa4652ad61ea2c3 (patch) | |
tree | 39a30ac454ae304a7571d20d5435fac1e8471543 /source4/ntvfs | |
parent | 0b6c611b11d2307490413e030959aef0cd2ab1ed (diff) | |
download | samba-84bbf02e95639536c34140906aa4652ad61ea2c3.tar.gz samba-84bbf02e95639536c34140906aa4652ad61ea2c3.tar.bz2 samba-84bbf02e95639536c34140906aa4652ad61ea2c3.zip |
r3239: reads of more than UINT16_MAX bytes should return 0 bytes
(This used to be commit 16c7dd641707b6b8b3159290ca9fa08053a10692)
Diffstat (limited to 'source4/ntvfs')
-rw-r--r-- | source4/ntvfs/ipc/vfs_ipc.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c index dcbfdb948f..f7eac65712 100644 --- a/source4/ntvfs/ipc/vfs_ipc.c +++ b/source4/ntvfs/ipc/vfs_ipc.c @@ -365,17 +365,23 @@ static NTSTATUS ipc_read(struct ntvfs_module_context *ntvfs, } fnum = rd->readx.in.fnum; - data.length = rd->readx.in.maxcnt; - data.data = rd->readx.out.data; p = pipe_state_find(private, fnum); if (!p) { return NT_STATUS_INVALID_HANDLE; } - status = dcesrv_output_blob(p->dce_conn, &data); - if (NT_STATUS_IS_ERR(status)) { - return status; + data.length = rd->readx.in.maxcnt; + data.data = rd->readx.out.data; + if (data.length > UINT16_MAX) { + data.length = 0; + } + + if (data.length != 0) { + status = dcesrv_output_blob(p->dce_conn, &data); + if (NT_STATUS_IS_ERR(status)) { + return status; + } } rd->readx.out.remaining = 0; |