[SERVER-23711] ModifierPush::init may coerce NaN to an integer Created: 14/Apr/16  Updated: 26/Apr/16  Resolved: 15/Apr/16

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: 3.3.5

Type: Bug Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: undefined-sanitizer
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Run the modifier_push_test under the undefined behavior sanitizer

Sprint: Platforms 13 (04/22/16)
Participants:

 Description   

ModifierPush::init, while validating parameters, reads the same value once as a double and once as an integer and compares them. However, if the double is not zero and also not normal, the behavior is undefined. For non-zero double values, the double value should be checked with std::isnormal before coercing to an integer.



 Comments   
Comment by Githook User [ 15/Apr/16 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-16221 SERVER-23711 Don't attempt to coerce non-normal double to int
Branch: master
https://github.com/mongodb/mongo/commit/53ca7d82c8203f85ca846fa6ece37257b0ec6717

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