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

Coverity analysis defect 99197: Not restoring ostream format

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial - P5
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.9
    • Component/s: HTTP Console
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Platforms 16 (06/24/16)

      Description

      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.

              }

        Attachments

          Activity

            People

            Assignee:
            acm Andrew Morrow
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: