[SERVER-41467] Integer overflow can trigger invariant during update in mongos Created: 03/Jun/19  Updated: 29/Oct/23  Resolved: 16/Sep/19

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

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Randolph Tan
Resolution: Fixed Votes: 1
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2019-07-15, Sharding 2019-07-29, Sharding 2019-08-12, Sharding 2019-08-26, Sharding 2019-09-23
Participants:
Case:

 Description   

"n" is long long, but gets assigned to an int, under right circumstances, a number that big enough and doesn't fit int can be interpreted as a negative number and trigger this invariant:

https://github.com/mongodb/mongo/blob/9d212e4f098ccf4821fd6a1acde60402373b70ee/src/mongo/s/commands/cluster_write_cmd.cpp#L119



 Comments   
Comment by Githook User [ 14/Sep/19 ]

Author:

{'name': 'Randolph Tan', 'email': 'randolph@mongodb.com'}

Message: SERVER-41467 Fix interger down convertion from long long to int inside batchErrorToLastError
Branch: master
https://github.com/mongodb/mongo/commit/4586863653a128dc9eb5f034792481ae781f47e3

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