mirror of
https://github.com/samba-team/samba.git
synced 2025-02-21 01:59:07 +03:00
r3239: reads of more than UINT16_MAX bytes should return 0 bytes
This commit is contained in:
parent
687633b5d6
commit
16c7dd6417
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user