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

common: make encode_scriptpubkey_to_addr take explicit len.

Public commit record

What the developer wrote

Authored by Rusty Russell

73/100 · Adequate
common: make encode_scriptpubkey_to_addr take explicit len.

Don't assume it's a tal array: this is useful for dealing with
wally_tx internals.

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

What changed, and why it matters

This change refactors a helper function that turns Bitcoin scriptPubKeys into human-readable addresses. Previously the function measured the length itself using a memory-tracking helper (tal_bytelen). Now callers pass the length explicitly. This is mostly a code-cleanup to support data that isn't tracked by that helper, such as internal libwally transaction buffers. There is no direct security bug being fixed, but the old pattern could theoretically lead to incorrect length handling if a non-tal buffer were passed in future code.

Recommended action

No urgent action required. Treat as routine refactoring with minor defensive value. Reviewers should verify that all call sites pass a correct length and that no caller now passes an unchecked attacker-controlled length without validation.

Security signals we found

01

API contract hardened: length now explicit rather than inferred from tal metadata

02

Potential future misuse reduced: non-tal buffers can now be encoded safely

03

No bounds-check or overflow fix present in diff

04

No memory allocation bug fixed in diff

05

No cryptographic bug fixed in diff

Risk score

Why this scored 18/100

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