Skip to content

Commit f4fdb19

Browse files
Chandra Prataprustyrussell
authored andcommitted
fuzz-tests: Test over all possible witness version values
According to `common/bech32.h`, the valid values of witness program version are between 0 and 16 (inclusive). Update the test to iterate over all of these values.
1 parent 83894fa commit f4fdb19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/fuzz/fuzz-bech32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void run(const uint8_t *data, size_t size)
4848
bech32_convert_bits(data_out, &data_out_len, 8, data, size, 5, 0);
4949

5050
addr = tal_arr(tmpctx, char, 73 + strlen(hrp_addr));
51-
for (int wit_version = 0; wit_version < 2; ++wit_version) {
51+
for (int wit_version = 0; wit_version <= 16; ++wit_version) {
5252
if (segwit_addr_encode(addr, hrp_addr, wit_version, data,
5353
size) == 0)
5454
continue;

0 commit comments

Comments
 (0)