Skip to content

Commit

Permalink
SourceLevelDebugPkg/Usb3: Make sure data from HW can fit in buffer
Browse files Browse the repository at this point in the history
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <[email protected]>
Cc: Hao A Wu <[email protected]>
Reviewed-by: Hao Wu <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
  • Loading branch information
niruiyu committed Oct 17, 2018
1 parent 7fb7259 commit 4d2b506
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4d2b506

Please sign in to comment.