Reviewed-by: Hao Wu <[email protected]> Best Regards, Hao Wu
> -----Original Message----- > From: Ni, Ruiyu > Sent: Monday, October 15, 2018 2:38 PM > To: [email protected] > Cc: Wu, Hao A > Subject: [PATCH 06/11] SourceLevelDebugPkg/Usb3: Make sure data from > HW can fit in buffer > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ruiyu Ni <[email protected]> > Cc: Hao A Wu <[email protected]> > --- > .../DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Transfer.c | > 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git > a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugComm > unicationLibUsb3Transfer.c > b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugComm > unicationLibUsb3Transfer.c > index fb48010a9a..fda43279a3 100644 > --- > a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugComm > unicationLibUsb3Transfer.c > +++ > b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugComm > unicationLibUsb3Transfer.c > @@ -556,6 +556,13 @@ XhcDataTransfer ( > > XhcExecTransfer (Handle, Urb, Timeout); > > + // > + // Make sure the data received from HW can fit in the received buffer. > + // > + if (Urb->Completed > *DataLength) { > + return EFI_DEVICE_ERROR; > + } > + > *DataLength = Urb->Completed; > > Status = EFI_TIMEOUT; > -- > 2.16.1.windows.1 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

