Merge "adbd: Fix check against valid payload size" am: 596f3b5384
am: 9a80494702
am: aeb5be6f45
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1428117 Change-Id: I8edbc03fa678a549cf037699b7ab2f6d953b4a44
This commit is contained in:
commit
74246334dd
1 changed files with 1 additions and 2 deletions
|
@ -584,12 +584,11 @@ struct UsbFfsConnection : public Connection {
|
|||
incoming_header_ = msg;
|
||||
} else {
|
||||
size_t bytes_left = incoming_header_->data_length - incoming_payload_.size();
|
||||
Block payload = std::move(block->payload);
|
||||
if (block->payload.size() > bytes_left) {
|
||||
HandleError("received too many bytes while waiting for payload");
|
||||
return false;
|
||||
}
|
||||
incoming_payload_.append(std::move(payload));
|
||||
incoming_payload_.append(std::move(block->payload));
|
||||
}
|
||||
|
||||
if (incoming_header_->data_length == incoming_payload_.size()) {
|
||||
|
|
Loading…
Reference in a new issue