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

Invalid access to empty boost::optional in multiSyncApply_noAbort()

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Replication, Storage
    • None
    • ALL
    • 0

      In multiSyncApply_noAbort(), OplogEntryBase::getTerm() returns a boost::optional, which isn't initialized in PV0, so calling get() on it is invalid.

                      // Populate the "t" (term) field with an array of all the grouped inserts' terms.
                      BSONArrayBuilder tArrayBuilder(groupedInsertBuilder.subarrayStart("t"));
                      for (auto groupingIterator = oplogEntriesIterator;
                           groupingIterator != endOfGroupableOpsIterator;
                           ++groupingIterator) {
                          tArrayBuilder.append(
                              static_cast<long long>((*groupingIterator)->getTerm().get()));
                      }
                      tArrayBuilder.done();
      

            Assignee:
            milkie@mongodb.com Eric Milkie
            Reporter:
            siyuan.zhou@mongodb.com Siyuan Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: