Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1160

Initialize bson_error_t structs to zero

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      While libmongoc can generally be trusted not to indicate an error without setting the bson_error_t struct, it's possible that an oversight could result in us calling phongo_throw_exception_from_bson_error_t() on an uninitialized bson_error_t, which will lead to a nonsense exception code and message.

      A defensive measure would be to initialize bson_error_t values with {0} everywhere. This is the same approached used in libmongoc's own test suite.

            Assignee:
            katherine.walker@mongodb.com Katherine Walker (Inactive)
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: