prep_tagsets may leak in convert_to_object

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.9.0-rc1, 1.9.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      While testing PHP 8, I discovered that php_phongo_read_preference_prep_tagsets may leak when invoked via php_phongo_readpreference_init_from_hash. This does not happen when called from ReadPreference's constructor, since the "/" modifier in zpp separates the dedicated tagSets zval; however, __set_state does not separate its argument.

      Rather than rely on zpp, we can work around the leak by separating the tagSets zval in php_phongo_read_preference_prep_tagsets directly.

      This bug likely dates back to PHPC-1206, which is when __set_state was introduced. When was originally implemented in PHPC-851, it was only called from the constructor.

            Assignee:
            Jeremy Mikola
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: