core-lightning/tests/fuzz
Matt Morehouse ee501b035b bolt11: avoid reading uninitialized memory
If both databits and *data_len are 0, pull_uint return uninitialized
stack memory in *val.

Detected by valgrind and UBSan.

valgrind:
==173904== Use of uninitialised value of size 8
==173904==    __sanitizer_cov_trace_cmp8
==173904==    decode_c (bolt11.c:292)
==173904==    bolt11_decode_nosig (bolt11.c:877)

UBSan:
common/bolt11.c:79:29: runtime error: shift exponent 64 is too large for 64-bit type 'uint64_t' (aka 'unsigned long')

Corpus input e6f7b9744a7d79b2aa4f7c477707bdd3483f40fa triggers the UBSan
report, but we didn't previously realize this because UBSan has been
disabled in the CI run. We rename the input to indicate its usefulness
as a permanent regression test.
2023-10-18 09:53:22 +10:30
..
corpora bolt11: avoid reading uninitialized memory 2023-10-18 09:53:22 +10:30
check-fuzz.sh fuzz: add check-fuzz.sh 2023-04-09 12:41:27 +09:30
connectd_handshake.h fuzz: add connectd_handshake.h 2023-06-22 13:40:45 +09:30
fuzz-addr.c fuzz: fix check-src/includes when fuzzing enabled. 2023-04-05 06:12:24 +09:30
fuzz-amount.c fuzz: fix check-src/includes when fuzzing enabled. 2023-04-05 06:12:24 +09:30
fuzz-base32-64.c fuzz: fix check-src/includes when fuzzing enabled. 2023-04-05 06:12:24 +09:30
fuzz-bech32.c fuzz: simplify fuzz-bech32.c 2023-05-27 15:06:31 +09:30
fuzz-bigsize.c fuzz: fix check-src/includes when fuzzing enabled. 2023-04-05 06:12:24 +09:30
fuzz-bip32.c fuzz: correct buffer length for bip32_key_version 2023-05-21 12:46:27 +02:00
fuzz-bolt11.c fuzz: test bolt11 decoding 2023-10-12 19:28:28 +02:00
fuzz-channel_id.c fuzz: fix check-src/includes when fuzzing enabled. 2023-04-05 06:12:24 +09:30
fuzz-close_tx.c fuzz: fix check-src/includes when fuzzing enabled. 2023-04-05 06:12:24 +09:30
fuzz-connectd-handshake-act1.c fuzz: add handshake act 1 target 2023-06-22 13:40:45 +09:30
fuzz-connectd-handshake-act2.c fuzz: add handshake act 2 target 2023-06-22 13:40:45 +09:30
fuzz-connectd-handshake-act3.c fuzz: add handshake act 3 target 2023-06-22 13:40:45 +09:30
fuzz-cryptomsg.c fuzz: test message encryption and decryption 2023-06-23 13:12:42 +09:30
fuzz-descriptor_checksum.c fuzz: fix check-src/includes when fuzzing enabled. 2023-04-05 06:12:24 +09:30
fuzz-hsm_encryption.c fuzz: fix check-src/includes when fuzzing enabled. 2023-04-05 06:12:24 +09:30
fuzz-initial_channel.c fuzz: fix check-src/includes when fuzzing enabled. 2023-04-05 06:12:24 +09:30
fuzz-ripemd160.c fuzz: add ripemd160 target 2023-07-10 14:56:50 +09:30
fuzz-sha256.c fuzz: add sha256 target 2023-07-10 14:56:50 +09:30
fuzz-wire-accept_channel2.c fuzz: target for accept_channel2 2023-09-18 13:58:45 +09:30
fuzz-wire-accept_channel.c fuzz: target for accept_channel 2023-09-18 13:58:45 +09:30
fuzz-wire-announcement_signatures.c fuzz: target for announcement_signatures 2023-09-18 13:58:45 +09:30
fuzz-wire-channel_announcement.c fuzz: target for channel_announcement 2023-09-18 13:58:45 +09:30
fuzz-wire-channel_ready.c fuzz: target for channel_ready 2023-09-18 13:58:45 +09:30
fuzz-wire-channel_reestablish.c fuzz: target for channel_reestablish 2023-09-18 13:58:45 +09:30
fuzz-wire-channel_update.c fuzz: target for channel_update 2023-09-18 13:58:45 +09:30
fuzz-wire-closing_signed.c fuzz: target for closing_signed 2023-09-18 13:58:45 +09:30
fuzz-wire-commitment_signed.c fuzz: target for commitment_signed 2023-09-18 13:58:45 +09:30
fuzz-wire-error.c fuzz: target for error 2023-09-18 13:58:45 +09:30
fuzz-wire-funding_created.c fuzz: target for funding_created 2023-09-18 13:58:45 +09:30
fuzz-wire-funding_signed.c fuzz: target for funding_signed 2023-09-18 13:58:45 +09:30
fuzz-wire-gossip_timestamp_filter.c fuzz: target for gossip_timestamp_filter 2023-09-18 13:58:45 +09:30
fuzz-wire-init.c fuzz: target for init 2023-09-18 13:58:45 +09:30
fuzz-wire-node_announcement.c fuzz: target for node_announcement 2023-09-18 13:58:45 +09:30
fuzz-wire-onion_message.c fuzz: target for onion_message 2023-09-18 13:58:45 +09:30
fuzz-wire-open_channel2.c fuzz: target for open_channel2 2023-09-18 13:58:45 +09:30
fuzz-wire-open_channel.c fuzz: target for open_channel 2023-09-18 13:58:45 +09:30
fuzz-wire-peer_storage.c fuzz: target for peer_storage 2023-09-18 13:58:45 +09:30
fuzz-wire-ping.c fuzz: target for ping 2023-09-18 13:58:45 +09:30
fuzz-wire-pong.c fuzz: target for pong 2023-09-18 13:58:45 +09:30
fuzz-wire-query_channel_range.c fuzz: target for query_channel_range 2023-09-18 13:58:45 +09:30
fuzz-wire-query_short_channel_ids.c fuzz: target for query_short_channel_ids 2023-09-18 13:58:45 +09:30
fuzz-wire-reply_channel_range.c fuzz: target for reply_channel_range 2023-09-18 13:58:45 +09:30
fuzz-wire-reply_short_channel_ids_end.c fuzz: target for reply_short_channel_ids_end 2023-09-18 13:58:45 +09:30
fuzz-wire-revoke_and_ack.c fuzz: target for revoke_and_ack 2023-09-18 13:58:45 +09:30
fuzz-wire-shutdown.c fuzz: target for shutdown 2023-09-18 13:58:45 +09:30
fuzz-wire-splice_ack.c fuzz: target for splice_ack 2023-09-18 13:58:45 +09:30
fuzz-wire-splice_locked.c fuzz: target for splice_locked 2023-09-18 13:58:45 +09:30
fuzz-wire-splice.c fuzz: target for splice 2023-09-18 13:58:45 +09:30
fuzz-wire-stfu.c fuzz: target for stfu 2023-09-18 13:58:45 +09:30
fuzz-wire-tx_abort.c fuzz: target for tx_abort 2023-09-18 13:58:45 +09:30
fuzz-wire-tx_ack_rbf.c fuzz: target for tx_ack_rbf 2023-09-18 13:58:45 +09:30
fuzz-wire-tx_add_input.c fuzz: target for tx_add_input 2023-09-18 13:58:45 +09:30
fuzz-wire-tx_add_output.c fuzz: target for tx_add_output 2023-09-18 13:58:45 +09:30
fuzz-wire-tx_complete.c fuzz: target for tx_complete 2023-09-18 13:58:45 +09:30
fuzz-wire-tx_init_rbf.c fuzz: target for tx_init_rbf 2023-09-18 13:58:45 +09:30
fuzz-wire-tx_remove_input.c fuzz: target for tx_remove_input 2023-09-18 13:58:45 +09:30
fuzz-wire-tx_remove_output.c fuzz: target for tx_remove_output 2023-09-18 13:58:45 +09:30
fuzz-wire-tx_signatures.c fuzz: target for tx_signatures 2023-09-18 13:58:45 +09:30
fuzz-wire-update_add_htlc.c fuzz: target for update_add_htlc 2023-09-18 13:58:45 +09:30
fuzz-wire-update_blockheight.c fuzz: target for update_blockheight 2023-09-18 13:58:45 +09:30
fuzz-wire-update_fail_htlc.c fuzz: target for update_fail_htlc 2023-09-18 13:58:45 +09:30
fuzz-wire-update_fail_malformed_htlc.c fuzz: target for update_fail_malformed_htlc 2023-09-18 13:58:45 +09:30
fuzz-wire-update_fee.c fuzz: target for update_fee 2023-09-18 13:58:45 +09:30
fuzz-wire-update_fulfill_htlc.c fuzz: target for update_fulfill_htlc 2023-09-18 13:58:45 +09:30
fuzz-wire-warning.c fuzz: target for warning 2023-09-18 13:58:45 +09:30
fuzz-wire-your_peer_storage.c fuzz: target for your_peer_storage 2023-09-18 13:58:45 +09:30
libfuzz.c fuzz: fix check-src/includes when fuzzing enabled. 2023-04-05 06:12:24 +09:30
libfuzz.h check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
Makefile fuzz: test bolt11 decoding 2023-10-12 19:28:28 +02:00
run.py fuzz: improve corpus merging 2023-04-09 12:41:27 +09:30
wire.h fuzz: target for accept_channel 2023-09-18 13:58:45 +09:30