device_ledger: fix buffer underflow on bad data from device

This commit is contained in:
moneromooo-monero 2018-06-23 15:43:31 +01:00
parent e389101cb2
commit 41662ebcc7
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
1 changed files with 1 additions and 0 deletions

View File

@ -304,6 +304,7 @@ namespace hw {
SCARD_PCI_T0, this->buffer_send, this->length_send,
NULL, this->buffer_recv, &this->length_recv);
ASSERT_RV(rv);
ASSERT_T0(this->length_recv >= 2);
ASSERT_T0(this->length_recv <= BUFFER_RECV_SIZE);
logRESP();