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

kernel: allow null data_directory

Public commit record

What the developer wrote

Authored by stickies-v

58/100 · Thin
kernel: allow null data_directory

An empty path may be represented with a nullptr. For example,
std::string_view::data() may return nullptr.

Removes the BITCOINKERNEL_ARG_NONNULL attribute for data_directory,
and instead handles such null arguments in the implementation.

Also documents how BITCOINKERNEL_ARG_NONNULL should be used.
✓ Descriptive subject✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit tightens input handling in Bitcoin Core's kernel library. Previously, the library's C interface promised that callers must not pass a null or empty directory path, but it did not actually check. Now it explicitly rejects null or empty data and blocks directories and returns an error instead of potentially misbehaving. It also updates the internal C++ wrapper to accept string views, which can legitimately have null data pointers when empty. This is a defensive hardening change, not a fix for an active exploit.

Recommended action

No immediate action required beyond normal review and merge. Users of the kernel library should ensure they pass non-null, non-empty directory strings. Downstream integrators using the C++ wrapper should note it now accepts std::string_view.

Security signals we found

01

Defensive null/empty input validation added to C API

02

Nonnull attribute narrowed to avoid undefined behavior on valid empty inputs

03

Documentation clarifies correct use of nonnull annotations

04

Unit tests added for null/empty directory arguments

Risk score

Why this scored 26/100

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