mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 06:41:44 +01:00
fuzz: correct buffer length for bip32_key_version
8 bytes are expected, not 4. Because we were passing the wrong number of bytes, parsing was failing every single time.
This commit is contained in:
parent
7d662b6b68
commit
8265a94858
1 changed files with 2 additions and 2 deletions
|
@ -42,14 +42,14 @@ void run(const uint8_t *data, size_t size)
|
|||
}
|
||||
tal_free(xkey_chunks);
|
||||
|
||||
ver_chunks = get_chunks(NULL, data, size, 4);
|
||||
ver_chunks = get_chunks(NULL, data, size, 8);
|
||||
for (size_t i = 0; i < tal_count(ver_chunks); i++) {
|
||||
wire_max = tal_bytelen(ver_chunks[i]);
|
||||
wire_ptr = ver_chunks[i];
|
||||
|
||||
fromwire_bip32_key_version(&wire_ptr, &wire_max, &version);
|
||||
if (wire_ptr) {
|
||||
wire_buff = tal_arr(NULL, uint8_t, 4);
|
||||
wire_buff = tal_arr(NULL, uint8_t, 8);
|
||||
towire_bip32_key_version(&wire_buff, &version);
|
||||
tal_free(wire_buff);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue