AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 17 Bitcoin

tests/fuzz/fuzz-open_channel: fix bad local variable access after longjmp

Public commit record

What the developer wrote

Authored by Matt Whitlock

100/100 · Strong
tests/fuzz/fuzz-open_channel: fix bad local variable access after longjmp

You can't access a local variable from a point before it was initialized and
expect it to have the initialized value. Move the setjmp() call to after
run_ctx is initialized so that the tal_free() call at cleanup will see the
correct address and not crash.

Fixes: https://github.com/ElementsProject/lightning/issues/9131
Changelog-None
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a crash bug inside a fuzz test, not in the main Core Lightning software. A fuzz test is an automated testing tool that feeds random data to a program to find crashes. The bug occurred because a safety net (setjmp/longjmp) could jump to cleanup code before a local variable (run_ctx) was initialized, causing the cleanup code to use an invalid memory address and crash. The fix simply moves the safety-net setup to after the variable is initialized. This does not affect real Lightning nodes or their users.

Recommended action

No action required for operators. Developers can merge the fix to keep fuzz tests stable. Treat as a test-quality fix, not a security patch.

Security signals we found

01

Use of uninitialized local variable in cleanup path

02

setjmp/longjmp control-flow hazard

03

Crash-only impact in fuzzing harness

04

No production code or network-facing change

Risk score

Why this scored 17/100

Our methodology →
Potential impact 2/30
Exploitability 0/25
Stealth signal 1/15
Affected reach 1/15
Confidence 9/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.