Skip to content

PHP Judy 2.8.0

Latest

Choose a tag to compare

@orieg orieg released this 09 Oct 04:05
df9ca33

PHP Judy 2.8.0

Hardening release: several memory-safety fixes, behavior tightening, and strict
__unserialize() validation.

Security fixes

  • Appending to a string-keyed array ($j[] = ...) no longer crashes; the append
    guard now enumerates all seven string-keyed types, including Judy::STRING_TO_ENTRY (#217).
  • forEach()/filter()/map() on STRING_TO_ENTRY read each value through the
    entry accessor instead of reinterpreting a cache-entry struct as a zval;
    equals() gained a matching ENTRY branch (#217).
  • set() rejects keys longer than the 64 KB key buffer before taking a slot
    (heap overflow); deleteRange() on string-keyed ENTRY arrays now frees the
    cache-entry struct and its value reference instead of leaking both (#217).

Fixes

  • Expired STRING_TO_ENTRY values are hidden from reads and traversals
    (iterator, get(), keys()/values()/toArray()) while count()/size()
    stay raw-counter O(1) until pruneExpired(). mergeWith() copies TTL and
    flags verbatim; get_gc() collects stored ENTRY values (#217).
  • Wrong-category range bounds now throw TypeError instead of silently coercing
    to a wrong-range read: int-keyed keys()/values()/toArray()/size()/
    slice() reject non-numeric string bounds, and string-keyed deleteRange()
    rejects integer bounds (#217).
  • __unserialize() validates the serialized type, payload shape and
    optimizeIteration flag strictly before touching the object, so a malformed
    payload throws without destroying or corrupting an already-populated array,
    and an out-of-range type throws instead of emitting an E_WARNING (#225).

Full diff: v2.7.1...v2.8.0

Install: pecl install judy-2.8.0 · pie install orieg/judy:2.8.0