[SERVER-61902] Coverity analysis defect 121189: Not restoring ostream format Created: 03/Dec/21  Updated: 29/Oct/23  Resolved: 30/Dec/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Spencer Jackson
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Security 2021-12-27, Security 2022-01-10
Participants:

 Description   

Not restoring ostream format

The next output operation may not expect the stream format state being altered, resulting in incorrectly formatted output. Not restoring the stream format state of an ostream
/src/mongo/db/modules/enterprise/src/kmip/kmip_request_test.cpp:66: STREAM_FORMAT_STATE 121189 "hex" changes the format state of "std::cout" for category basefield.
/src/mongo/db/modules/enterprise/src/kmip/kmip_request_test.cpp:72: STREAM_FORMAT_STATE 121189 Changing format state of stream "std::cout" for category basefield without later restoring it.



 Comments   
Comment by Githook User [ 30/Dec/21 ]

Author:

{'name': 'Spencer Jackson', 'email': 'spencer.jackson@mongodb.com', 'username': 'spencerjackson'}

Message: SERVER-61902 Replace std::hex with hex helpers in tests
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/32b4b77d026a9bef892592cfda42708f031c6139

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