Version 9.3.2

September 20, 2026

Release Notes

This release addresses a memory-safety defect in XOR-assisted serialization that could cause writes beyond an allocated heap buffer. Updating is recommended for applications that enable XOR filtering, including serialization of related sparse-vector bit planes and columns.

Integration: BitMagic is header-only. Update the headers and rebuild applications that use the affected serializers. The principal implementation changes are in bmserial.h and bmfunc.h.

Memory Safety Fix

  • Fixed a potential heap-buffer overwrite during serialization. An XOR filter could appear beneficial to the compression predictor but produce a larger encoded block than ordinary compression. In combination with underestimated output-buffer capacity, this could cause writes beyond the allocated buffer. The issue was reproduced with optimized sparse vectors using XOR references at compression level 0.
  • Corrected serialization buffer-size estimates for GAP-only bit-vectors. The estimate now includes the additional full-block working allowance needed during speculative encoding, including XOR products of GAP blocks. See the buffer-sizing fix.
  • XOR is now selected by actual encoded size. For each candidate 65,536-bit block, the serializer compares ordinary encoding with the complete XOR alternative, including reference identifiers, masks, chain metadata and the encoded residual. XOR is retained only when it is strictly smaller; equal or larger candidates fall back to ordinary encoding using the existing codecs, including Binary Interpolative Coding (BIC) and raw blocks.
  • Speculative XOR encoding uses a separate reusable buffer. An expanding trial is evaluated without writing into the caller's output buffer. Selection remains per block, allowing beneficial XOR compression and ordinary encoding to coexist within the same bit plane. See the XOR selection fix.

Compatibility and Regression Coverage

  • No serialization format, token or decoder changes are required by this fix. Existing serialized data remains readable; output bytes may change because the serializer now rejects inefficient XOR candidates.
  • Added regression coverage for XOR expansion and savings, mixed XOR/BIC/raw blocks, compression levels, bookmarks, range decoding, and RAM/file serialization consistency.

Other Updates

  • MSVC improvements.

GitHub

Follow us on Twitter