Files
dragonx/src/wallet
DanS 762e25294f fix: guard BuildWitnessCache against an off-active-chain pindex (heap overflow)
BuildWitnessCache sizes its blockCms buffer from pindex->GetHeight() but the
Phase-1 loop walks the active chain (chainActive.Next), terminating only on
pbi==pindex. If a reorg moved pindex off the active chain while the notify
thread lagged (cs_main is released between per-block ChainTip calls) and the new
active tip is taller, the loop never reaches pindex and, once past pindex's
height, writes blockCms[h-startHeight] out of bounds -- a heap overflow.
Rebuilding witnesses for an abandoned block is meaningless anyway, so bail early
when pindex is not on the active chain; cs_main is held for the whole function,
so the check cannot race the loop.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 05:48:39 +02:00
..
2024-02-27 23:59:59 +01:00
2024-02-27 23:59:59 +01:00
2024-02-27 23:59:59 +01:00
2024-02-27 23:59:59 +01:00
2024-02-27 23:59:59 +01:00
2024-02-27 23:59:59 +01:00
2024-02-27 23:59:59 +01:00
2024-02-27 23:59:59 +01:00
2020-12-04 09:46:21 -05:00
2024-02-27 23:59:59 +01:00
2024-10-01 10:49:13 -04:00
2024-02-27 23:59:59 +01:00
2024-02-27 23:59:59 +01:00