aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-06-23 15:43:31 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-06-23 15:43:31 +0100
commit34de7bc267984340d0c6c0afcbb1069af2f81e6d (patch)
tree61d11a2ce6c8c05b84c2bcf430770b77a673969d
parentdevice: misc cleanup (diff)
downloadmonero-34de7bc267984340d0c6c0afcbb1069af2f81e6d.tar.xz
device_ledger: fix buffer underflow on bad data from device
-rw-r--r--src/device/device_ledger.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp
index 8735baeb6..bc7f37789 100644
--- a/src/device/device_ledger.cpp
+++ b/src/device/device_ledger.cpp
@@ -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();