Skip to content

Commit 2bf928b

Browse files
ldg-github-ciapaillier-ledger
authored andcommitted
[update] Branch develop | Commit c6a909ab389e18c5573b0cbc9cb6eaf931fddb02
[update] Branch develop | Commit 9e247284772bf3f8f87c3ea18c843ce15168543a
1 parent 8fe6572 commit 2bf928b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
| :rotating_light: | Breaks build |
66
| :warning: | Breaks compatibility with app |
77

8-
## [latest](/) - 2024/03/27
8+
## [latest](/) - 2024/04/12
9+
10+
### Fixed
11+
12+
* Fix potential oob writes in `amountToString`
13+
14+
## [8fe6572](/../../commit/8fe6572) - 2024/03/27
915

1016
### Changed
1117

src/common_utils.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,11 @@ bool amountToString(const uint8_t *amount,
199199
uint8_t amount_len = strnlen(tmp_buffer, sizeof(tmp_buffer));
200200
uint8_t ticker_len = strnlen(ticker, MAX_TICKER_LEN);
201201

202-
memcpy(out_buffer, ticker, MIN(out_buffer_size, ticker_len));
203202
if (ticker_len > 0) {
203+
if (out_buffer_size <= ticker_len + 1) {
204+
return false;
205+
}
206+
memcpy(out_buffer, ticker, ticker_len);
204207
out_buffer[ticker_len++] = ' ';
205208
}
206209

0 commit comments

Comments
 (0)