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

pytest: fix channeld_fakenet divide by zero bug.

Public commit record

What the developer wrote

Authored by Rusty Russell

80/100 · Strong
pytest: fix channeld_fakenet divide by zero bug.

1. If max was 0, we crashed with SIGFPE due to % 0.
2. If min was non-zero, logic was incorrect (but all callers had min == 0).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit fixes a divide-by-zero bug and a logic error in a fake network plugin used only during testing. The affected code is not part of the production Core Lightning software, so real users are not at risk. The bug could crash the test plugin if a certain parameter was zero, and a separate logic error meant ranges with non-zero minimums were computed incorrectly.

Recommended action

No production action needed; ensure test suite includes coverage for edge cases such as max == min or max == 0 in channel_range().

Security signals we found

01

divide-by-zero / SIGFPE in test-only plugin

02

incorrect range-scaling logic when min != 0

03

fix located in tests/plugins/ directory (non-production)

Risk score

Why this scored 18/100

Our methodology →
Potential impact 2/30
Exploitability 1/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.