[SERVER-24286] Coverity analysis defect 99197: Not restoring ostream format Created: 25/May/16  Updated: 05/Jul/16  Resolved: 24/Jun/16

Status: Closed
Project: Core Server
Component/s: HTTP Console
Affects Version/s: None
Fix Version/s: 3.3.9

Type: Bug Priority: Trivial - P5
Reporter: Coverity Collector User Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 16 (06/24/16)
Participants:

 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.

        }



 Comments   
Comment by Githook User [ 24/Jun/16 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-24286 Restore stream state flags when writing top output
Branch: master
https://github.com/mongodb/mongo/commit/9d9050d7c093789b262b59139f4c50709cd0ccc8

Generated at Thu Feb 08 04:05:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.