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

common: assert that they don't call setup_tmpctx() twice.

Public commit record

What the developer wrote

Authored by Rusty Russell

85/100 · Strong
common: assert that they don't call setup_tmpctx() twice.

Otherwise, leaks will occur. And fix up dualopend and devtool/route,
which do this!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Specific, 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 adds a safety check to prevent a temporary memory context from being created twice, which would leak memory. It also fixes two places in the code that were accidentally doing so. The change is defensive and improves reliability, but it does not appear to be a directly exploitable security vulnerability.

Recommended action

Treat as a routine code-quality and robustness improvement. Review whether any other daemons or tools also call common_setup() and then setup_tmpctx()/setup_locale() separately, and ensure CI or static analysis catches duplicate tmpctx initialization.

Security signals we found

01

Memory leak prevention via assertion on global tmpctx initialization

02

Removal of duplicate tmpctx setup in devtools/route.c

03

Replacement of common_setup() with setup_locale() in openingd/dualopend.c to avoid double tmpctx creation

04

No explicit security framing by the vendor

Risk score

Why this scored 21/100

Our methodology →
Potential impact 3/30
Exploitability 2/25
Stealth signal 4/15
Affected reach 3/15
Confidence 6/10
Evidence quality 3/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.