diff options
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; |