Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-759

document/array::view.begin() != .end() for empty documents

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 0.2.0
    • Fix Version/s: 3.0.0-rc0
    • Component/s: BSON
    • Labels:
      None
    • Sprint:
      Platform D (12/11/15)

      Description

      For empty documents, a la

      auto value = builder::stream::array{} << finalize;
      auto view = value.view();
      // view().begin() != view().end();
      

      This is because we don't check the return value of bson_iter_next() when we first initialize the iterator, so users can end up with invalid iterators.

      We should check the return value

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: