[SERVER-63410] Coverity analysis defect 121444: Array compared against 0 Created: 08/Feb/22  Updated: 27/Oct/23  Resolved: 11/Apr/22

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Timour Katchaounov
Resolution: Gone away Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Sprint: QO 2022-02-21, QO 2022-03-07, QO 2022-03-21, QO 2022-04-04, QO 2022-04-18
Participants:

 Description   

Array compared against 0

The address of an array is never NULL, so the comparison will always evaluate the same way. Array compared against NULL pointer
/src/mongo/db/query/optimizer/props.cpp:176: NO_EFFECT 121444 Comparing an array to null is not useful: """", since the test will always evaluate as true.



 Comments   
Comment by Timour Katchaounov [ 11/Apr/22 ]

This issue has been fixed as a side-effect of commit 7b8ecd4a93a5838ce5acbb7d49ef61fad60d1b3e (SERVER-63635).

The commit removes an empty string argument that was passed into a bool parameter. This cast caused the Coverity issue.

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