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

common/bolt12: use a const char * for fail reason.

Public commit record

What the developer wrote

Authored by Rusty Russell

65/100 · Adequate
common/bolt12: use a const char * for fail reason.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit is a code-quality refactor across many files. It changes the 'failure reason' string returned by BOLT11/BOLT12 decoding functions from a mutable 'char *' to a read-only 'const char *'. It also exposes a previously internal helper function and adds memory ownership fixes so callers don't accidentally use freed error strings. There is no direct evidence in the commit message or diff that this fixes an active security vulnerability, but it removes a class of potential memory-management mistakes and makes the API safer for future callers.

Recommended action

Treat as a routine refactor with minor defensive-security value. Review that all callers now treat the failure string as const and do not attempt to free or modify it. No urgent patching is indicated by the diff alone, but include it in normal update cycles.

Security signals we found

01

Memory ownership fix: tal_steal(ctx, *fail) added in three BOLT12 decode paths

02

API hardening: decode failure strings are now const, discouraging mutation/use-after-free

03

Previously internal helper string_to_data() made public as b12_string_to_data()

04

No mention of CVE, security bug, or researcher attribution in commit message

Risk score

Why this scored 22/100

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