Initialize bson_error_t structs to zero

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.5.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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 (Inactive)
              Reporter:
              Jeremy Mikola
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: