[SERVER-39721] UB on min int in push_node.cpp Created: 21/Feb/19  Updated: 29/Oct/23  Resolved: 11/Apr/19

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

Type: Bug Priority: Major - P3
Reporter: Jacob Evans Assignee: Ian Boros
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2019-04-22
Participants:

 Description   

Sign reversal on an integer with minimum value is UB. push_node.cpp contains an unprotected unary minus on an integer that is based on user input. https://github.com/mongodb/mongo/blob/6d56e6da95f9aa3792f5b234edb6c9117be3663f/src/mongo/db/update/push_node.cpp#L220



 Comments   
Comment by Githook User [ 11/Apr/19 ]

Author:

{'name': 'Ian Boros', 'username': 'puppyofkosh', 'email': 'puppyofkosh@gmail.com'}

Message: SERVER-39721 Fix unary minus on value which can be min int
Branch: master
https://github.com/mongodb/mongo/commit/0be76c660815bfdf898dec790905eab6f0b70f0a

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