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

Coverity analysis defect 99197: Not restoring ostream format

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 3.3.9
    • Affects Version/s: None
    • Component/s: HTTP Console
    • Fully Compatible
    • ALL
    • Platforms 16 (06/24/16)

      Not restoring the stream format state of an ostream

      Defect 99197 (STATIC_C)
      Checker STREAM_FORMAT_STATE (subcategory none)
      File: /src/mongo/db/stats/snapshots_webplugins.cpp
      Function mongo::<unnamed>::DBTopStatus::display(std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>> &, double, const mongo::Top::UsageData &)
      /src/mongo/db/stats/snapshots_webplugins.cpp, line: 58
      "setprecision" changes the format state of "ss" for category precision.

                      ss << setprecision(1) << fixed << per;
      

      /src/mongo/db/stats/snapshots_webplugins.cpp, line: 58
      "fixed" changes the format state of "ss" for category floatfield.

                      ss << setprecision(1) << fixed << per;
      

      /src/mongo/db/stats/snapshots_webplugins.cpp, line: 61
      Changing format state of stream "ss" for categories floatfield, precision without later restoring it.

              }
      

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: