Pádraig Brady
2ef53e5b04
basenc: --base58: fix buffer overflow with input > 15MB
...
base58_length() operated naively on an int
which resulted in an overflow to a negative number
for any input > 2^31-1/138, i.e. 15,561,475 bytes.
* src/basenc.c (base_length): Change input and output
parameter types from int to idx_t since this needs to
cater for the full input size in the base58 case.
(base58_length): Likewise. Also reorder the calculation
to be less exact, but doing the division first
to minimize the chance of overflow (which now on 64 bit
would only happen for inputs > around 6 Exa bytes).
* tests/basenc/basenc-large.sh: Add a new test,
that triggers with valgrind or ASAN.
* tests/local.mk: Reference the new test.
* NEWS: Mention the bug fix.
2025-09-23 20:35:34 +01:00
..
2025-09-23 20:35:34 +01:00
2025-07-01 23:32:31 +01:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-08-19 11:41:17 -07:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-09-21 11:30:40 -07:00
2025-08-23 18:55:46 +01:00
2025-04-08 16:07:06 +01:00
2025-01-01 09:33:08 +00:00
2025-07-23 07:49:49 -07:00
2025-09-20 22:12:58 +01:00
2025-09-17 12:20:24 -07:00
2025-09-22 00:09:03 +01:00
2025-09-19 16:40:09 -07:00
2025-01-01 09:33:08 +00:00
2025-07-09 17:12:40 -07:00
2025-01-01 09:33:08 +00:00
2025-09-21 16:37:26 +01:00
2025-01-01 09:33:08 +00:00
2025-01-15 22:43:18 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-07-22 21:15:17 +01:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-09-22 11:23:50 +01:00
2025-09-17 21:37:35 +01:00
2025-01-20 15:21:58 +00:00
2025-03-23 12:01:18 -07:00
2025-01-20 15:21:58 +00:00
2025-09-21 11:30:12 -07:00
2025-08-12 17:50:40 +01:00
2025-01-01 09:33:08 +00:00
2025-01-15 17:07:19 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-08-03 10:55:54 -07:00
2025-08-12 17:50:40 +01:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-09-02 21:14:34 -07:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-08-05 18:46:04 -07:00
2025-04-04 21:14:29 +01:00
2025-01-01 09:33:08 +00:00
2025-06-22 17:00:02 +01:00
2025-01-01 09:33:08 +00:00
2025-09-21 13:45:54 +01:00
2025-01-01 09:33:08 +00:00
2025-04-05 11:37:58 +01:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-06-20 12:15:27 -07:00
2025-01-01 09:33:08 +00:00
2025-09-14 13:43:49 +01:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2015-11-06 16:40:42 +00:00
2025-01-01 09:33:08 +00:00
2011-04-13 11:18:48 +01:00
2012-09-14 10:20:03 +02:00
2006-08-16 20:11:42 +00:00
2025-09-23 20:35:34 +01:00
2015-11-10 13:03:33 +00:00
2025-01-01 09:33:08 +00:00
2025-01-01 09:33:08 +00:00
2021-05-12 22:14:11 +01:00