[SERVER-60380] Coverity analysis defect 120851: Improper use of negative value Created: 01/Oct/21  Updated: 29/Oct/23  Resolved: 08/Oct/21

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Matthew Russotto
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
Participants:

 Description   

Improper use of negative value

The negative value may be unexpected by later operations, causing incorrect computations. Negative value can be returned from function is not being checked before being used improperly
/src/mongo/db/modules/enterprise/src/fcbis/file_copy_based_initial_syncer.cpp:900: NEGATIVE_RETURNS 120851 Assigning: "fileSize" = "metadata[mongo::StringData("fileSize")].safeNumberLong()".



 Comments   
Comment by Githook User [ 07/Oct/21 ]

Author:

{'name': 'Matthew Russotto', 'email': 'matthew.russotto@mongodb.com', 'username': 'mtrussotto'}

Message: SERVER-60380 Fix coverity analysis defect 120851: Improper use of negative value
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/bc042697788af8bc397a677f83040163c8c00df9

Comment by Githook User [ 05/Oct/21 ]

Author:

{'name': 'Matthew Russotto', 'email': 'matthew.russotto@mongodb.com', 'username': 'mtrussotto'}

Message: SERVER-60380 Fix coverity analysis defect 120851: Improper use of negative value
Branch: matthew.russotto/SERVER-60380
https://github.com/10gen/mongo-enterprise-modules/commit/7d4666c709611d97712d1c7d153a7d65f2ee0709

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