Document may leak when decoding invalid BSON

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • PHP Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      The actual leaks might be related to php_phongo_bson_to_zval_ex(). This was observed in several BSON binary corpus tests that decode invalid canonical BSON strings (PHPC-2634). Those tests are marked as XFAIL pending this investigation.

      Additionally, when var_dump()-ing a Document instance with invalid BSON, an empty object may still be dumped despite an exception also being thrown. For example, some of the corpus tests generate the following output:

      object(MongoDB\BSON\Document)#2 (0) {
      }
      OK: Got MongoDB\Driver\Exception\InvalidArgumentException
      

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

              Created:
              Updated: