[SERVER-63831] Coverity analysis defect 121569: Improper use of negative value Created: 18/Feb/22  Updated: 29/Oct/23  Resolved: 24/Feb/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc0

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

Attachments: PNG File Screen Shot 2022-02-18 at 9.47.05 AM.png    
Issue Links:
Problem/Incident
is caused by SERVER-61134 Call voteCommitMigrationProgress with... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Server Serverless 2022-03-07
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/repl/tenant_migration_shard_merge_util.cpp:149: NEGATIVE_RETURNS 121569 Assigning: "fileSize" = "metadataDoc[mongo::StringData("fileSize")].safeNumberLong()".



 Comments   
Comment by Githook User [ 24/Feb/22 ]

Author:

{'name': 'Christopher Caplinger', 'email': 'christopher.caplinger@mongodb.com', 'username': 'UnicodeSnowman'}

Message: SERVER-63831: Assert that filesize is non-negative
Branch: master
https://github.com/mongodb/mongo/commit/e9dec3c50147c0a241e16235cc0c41dd127c4971

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