[SERVER-45639] Use safeNumberLong() to parse wTimeout from command Created: 17/Jan/20  Updated: 29/Oct/23  Resolved: 28/Jan/20

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

Type: Bug Priority: Major - P3
Reporter: Jason Chan Assignee: Jason Chan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-45584 Validate writeConcern.w Closed
is related to SERVER-70360 Do not allow extremely large write co... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2020-01-27, Repl 2020-02-10
Participants:
Linked BF Score: 95

 Description   

We currently parse the wTimeout field of a writeConcern object using numberInt(). However, the documentation for numberInt() states that we will get undefined behavior for cases like when given a double too large/small to be expressed as an int or a double that is NaN. The documentation suggests using safeNumberLong() instead.



 Comments   
Comment by Githook User [ 25/Jan/20 ]

Author:

{'username': 'jasonjhchan', 'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com'}

Message: SERVER-45639 Use safeNumberLong() to parse wTimeout from command
Branch: master
https://github.com/mongodb/mongo/commit/27c44d402377e9b716d3106ef8fcca56dcb0de97

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