Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-41989

BSONObjBuilder::asTempObj is not exception safe

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.3.1
    • 3.6.13, 4.0.10, 4.2.0-rc2
    • Internal Code
    • None
    • Fully Compatible
    • ALL
    • v4.2, v4.0, v3.6
    • Dev Tools 2019-07-15, Dev Tools 2019-07-29

    Description

      If this line throws, e.g. due to the object we're trying to construct being too large, this leaves the BSONObjBuilder in a state where "_doneCalled" is true, which can later lead to this invariant being hit unexpectedly. We should either make this function exception-safe and reset the state of the BSONObjBuilder to how it was before calling _done() in this line, if possible, and if not, we should update callers to be prepared for the possibility of this throwing.

      Attachments

        Activity

          People

            adam.martin@mongodb.com ADAM Martin (Inactive)
            matthew.saltz@mongodb.com Matthew Saltz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: