Fixed oob read in parallel_process_irp_read

This commit is contained in:
akallabeth 2020-04-15 17:06:35 +02:00
parent 917daa8b56
commit 6efa8290d8

View File

@ -149,6 +149,8 @@ static UINT parallel_process_irp_read(PARALLEL_DEVICE* parallel, IRP* irp)
UINT64 Offset; UINT64 Offset;
ssize_t status; ssize_t status;
BYTE* buffer = NULL; BYTE* buffer = NULL;
if (Stream_GetRemainingLength(irp->input) < 12)
return ERROR_INVALID_DATA;
Stream_Read_UINT32(irp->input, Length); Stream_Read_UINT32(irp->input, Length);
Stream_Read_UINT64(irp->input, Offset); Stream_Read_UINT64(irp->input, Offset);
buffer = (BYTE*)malloc(Length); buffer = (BYTE*)malloc(Length);