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

tools/generate-wire.py: don't set TLV fields to NULL if they're empty.

Public commit record

What the developer wrote

Authored by Rusty Russell

83/100 · Strong
tools/generate-wire.py: don't set TLV fields to NULL if they're empty.

There's a new BOLT 12 test, which checks that the ->currencies array isn't empty.
We were treating it as missing, which is wrong. So allocate empty arrays when
they appear, instead of setting them to NULL.

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

What changed, and why it matters

This is a one-line code generator fix in Core Lightning's wire protocol tooling. Previously, when a variable-length array field (common in newer Lightning protocol messages like BOLT 12) had zero elements, the generated code set the pointer to NULL. Now it always allocates an empty array. This corrects behavior where an empty-but-present list could be mistaken for a missing list, which could cause protocol compliance failures or logic errors in BOLT 12 features.

Recommended action

Review generated parsers and any code paths that test variable-length array pointers against NULL to ensure they now correctly handle empty arrays. Consider whether any existing checks rely on NULL to mean 'field absent' and update them. No immediate emergency patch is indicated, but the change should be included in the next release.

Security signals we found

01

Protocol parser semantic change: empty array now distinguished from missing field

02

BOLT 12 / TLV parsing context

03

Potential for logic bugs where NULL was interpreted as absent

04

No explicit security claim in commit message

Risk score

Why this scored 35/100

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