When a numeric array was encoded to BSON, the hash's apply counter was incremented and decremented irrespective of whether apply protection was enabled. This was not compatible with immutable arrays, which may be created by OPcache. We should consult ZEND_HASH_APPLY_PROTECTION() whenever an apply counter might be modified.
Previously, object_to_bson() incremented the apply counter when converting a MongoDB\BSON\Type instance. Associative arrays and other objects were not protected from recursion and could segfault when being encoded if they contained circular references.
- related to
-
PHPC-948 BSON encoding should throw on circular references
- Closed
- links to