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

silentpayments: allow NULL arrays in scan_outputs if n_tx_outputs is 0

Public commit record

What the developer wrote

Authored by Sebastian Falbesoner

73/100 · Adequate
silentpayments: allow NULL arrays in scan_outputs if n_tx_outputs is 0

Since the previous commit, scan_outputs accepts a transaction without
taproot outputs and returns 0. It still required tx_outputs and
found_outputs to be non-NULL, so a caller passing an empty array as
NULL (e.g., data() of an empty std::vector in C++) would still abort.

Neither array is dereferenced if n_tx_outputs is 0, so only check them
for NULL if n_tx_outputs > 0, and drop their SECP256K1_ARG_NONNULL
attributes. This matches how prevouts_summary_create and
sender_create_outputs treat empty key arrays.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a minor API usability issue in the experimental silent payments module. Previously, a function that scans transaction outputs for silent payments would crash if given empty arrays represented as NULL pointers, even though it did not actually need to read any data. The change allows NULL pointers when the number of outputs is zero, matching how similar functions already behave. It is a defensive hardening fix rather than an active security vulnerability.

Recommended action

No urgent action required. Treat as routine defensive fix. If using the silent payments module, ensure the updated API contract is followed and consider updating bindings to allow NULL empty arrays.

Security signals we found

01

NULL pointer argument check relaxed for empty arrays

02

SECP256K1_ARG_NONNULL attributes removed for two parameters

03

New API test verifying NULL-with-zero-length behavior

04

Matches existing pattern in prevouts_summary_create and sender_create_outputs

Risk score

Why this scored 30/100

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