[SERVER-63524] Coverity analysis defect 121518: Macro compares unsigned to 0 Created: 10/Feb/22  Updated: 29/Oct/23  Resolved: 15/Feb/22

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: David Storch
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-10 at 4.11.09 PM.png    
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QE 2022-02-21
Participants:

 Description   

Macro compares unsigned to 0

An unsigned value can never be negative, so this test will always evaluate the same way. An unsigned value can never be less than 0
/src/mongo/db/query/bind_input_params.cpp:162: NO_EFFECT 121518 This greater-than-or-equal-to-zero comparison of an unsigned value is always true. "value >= 0UL".



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

Author:

{'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}

Message: SERVER-63524 Fix tautological assertion in input param binding code for $type
Branch: master
https://github.com/mongodb/mongo/commit/adc87616486e39978046a50c27f9d4349ba4bce0

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