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

ccan: update ccan to fe99a8e0

Public commit record

What the developer wrote

Authored by Níckolas Goline

76/100 · Adequate
ccan: update ccan to fe99a8e0

Includes rustyrussell/ccan#129, which replaces asort's old quicksort
fallback with glibc 2.43's mergesort+heapsort. The old fallback called
cmp(pivot, pivot) on all-equal arrays, violating the comparator contract
that pointer identity implies distinct elements. Mergesort never
self-compares, matching qsort_r behaviour on systems without it.

This unblocks removing the temporary self-comparison guard in
cmp_rr_number().

Changelog-None
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit updates an internal sorting library used by Core Lightning. The old sorting code could call a comparison function with the exact same item twice when sorting arrays where every element is equal. The commit replaces that old code with a newer version that never does this, and adds tests to confirm. The change is defensive: it removes a place where a comparator could receive an unexpected self-comparison, which could in theory cause bugs or crashes if a comparator assumed the two pointers would always be different.

Recommended action

Treat as a hardening/defensive fix. Review any custom comparators in Core Lightning that previously assumed distinct pointers, since the temporary guard in cmp_rr_number() is intended to be removed. No immediate exploit is evident, but the change reduces a class of potential undefined behavior or crashes from comparator misuse.

Security signals we found

01

Old quicksort fallback called comparator with identical pointers on all-equal arrays

02

Comparator contract violation: pointer identity no longer implies distinct elements

03

Sorting routine replaced with glibc mergesort+heapsort to avoid self-comparisons

04

New regression tests added for all-equal arrays and single-element arrays

05

Commit message frames change as unblocking removal of a temporary self-comparison guard elsewhere

Risk score

Why this scored 47/100

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