ExportXMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 2.5.7
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • 2
    • None
    • PHP Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      Track https://github.com/mongodb/mongo-php-driver/pull/2212 

      Passing a DateTimeInterface subclass whose constructor does not call the parent constructor to MongoDB\BSON\UTCDateTime::__construct() crashes the process with a segmentation fault. The object has no internal time value, and phongo_utcdatetime_init_from_date() dereferences the NULL time pointer.

       

      class MyDateTime extends DateTime
      {
          public function __construct() {}
      }
      
      new MongoDB\BSON\UTCDateTime(new MyDateTime()); // Segmentation fault
      

       

            Assignee:
            Jérôme Tamarelle
            Reporter:
            Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: