[SERVER-61270] Coverity analysis defect 121083: Macro compares unsigned to 0 Created: 05/Nov/21  Updated: 29/Oct/23  Resolved: 11/Nov/21

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Tyler Seip (Inactive)
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2021-11-15, Service Arch 2021-11-22
Participants:
Story Points: 1

 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/transport/proxy_protocol_header_parser.cpp:103: NO_EFFECT 121083 This greater-than-or-equal-to-zero comparison of an unsigned value is always true. "value >= 0U".



 Comments   
Comment by Githook User [ 11/Nov/21 ]

Author:

{'name': 'Tyler Seip', 'email': 'Tyler.Seip@mongodb.com', 'username': 'tseip-mongo'}

Message: SERVER-61270: Correct coverity defect in proxy protocol parser
Branch: master
https://github.com/mongodb/mongo/commit/5a2f0797756fb09d5c8284e030f0cb63b7b76ec1

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