aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/device/device_ledger.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp
index eba633da8..2d91b881b 100644
--- a/src/device/device_ledger.cpp
+++ b/src/device/device_ledger.cpp
@@ -320,7 +320,9 @@ namespace hw {
bool device_ledger::reset() {
reset_buffer();
int offset = set_command_header_noopt(INS_RESET);
- memmove(this->buffer_send+offset, MONERO_VERSION, strlen(MONERO_VERSION));
+ const size_t verlen = strlen(MONERO_VERSION);
+ ASSERT_X(offset + verlen <= BUFFER_SEND_SIZE, "MONERO_VERSION is too long")
+ memmove(this->buffer_send+offset, MONERO_VERSION, verlen);
offset += strlen(MONERO_VERSION);
this->buffer_send[4] = offset-5;
this->length_send = offset;