Skip to content

Commit dd8906c

Browse files
committed
fuzz: fix uninitialized variable in fuzz-handle_onion_message
Changelog-Fixed: fuzz-handle_onion_message: fix variable used uninitialized when setjmp returns via longjmp. Fixes: #8683
1 parent 03a2736 commit dd8906c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/fuzz/fuzz-handle_onion_message.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ void init(int *argc, char ***argv)
7575

7676
void run(const uint8_t *data, size_t size)
7777
{
78-
if (setjmp(fuzz_env) != 0)
79-
goto cleanup;
80-
81-
struct daemon *daemon;
78+
struct daemon *daemon = NULL;
8279
struct peer *peer;
8380
struct pubkey dummy_key;
8481

82+
if (setjmp(fuzz_env) != 0)
83+
goto cleanup;
84+
8585
memset(&dummy_key, 'c', sizeof(dummy_key));
8686

8787
daemon = new_daemon(tmpctx);

0 commit comments

Comments
 (0)