mirror of
https://github.com/esphome/esphome.git
synced 2026-10-06 10:56:43 +00:00
[multiple] Fix crashes from malformed external input (batch 2) (#14651)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
9418f35cc3
commit
fecedeb018
@@ -492,6 +492,11 @@ bool USBClient::transfer_in(uint8_t ep_address, const transfer_cb_t &callback, u
|
||||
ESP_LOGE(TAG, "Too many requests queued");
|
||||
return false;
|
||||
}
|
||||
if (length > trq->transfer->data_buffer_size) {
|
||||
ESP_LOGE(TAG, "transfer_in: data length %u exceeds buffer size %u", length, trq->transfer->data_buffer_size);
|
||||
this->release_trq(trq);
|
||||
return false;
|
||||
}
|
||||
trq->callback = callback;
|
||||
trq->transfer->callback = transfer_callback;
|
||||
trq->transfer->bEndpointAddress = ep_address | USB_DIR_IN;
|
||||
|
||||
Reference in New Issue
Block a user