[SERVER-68823] Coverity analysis defect 122808: Dereference after null check Created: 15/Aug/22  Updated: 29/Oct/23  Resolved: 27/Jan/23

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Alexander Ignatyev
Resolution: Fixed Votes: 0
Labels: coverity, quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Dereference after null check

Either the check against null is unnecessary, or there may be a null pointer dereference. Pointer is checked against null but then dereferenced anyway
/src/mongo/db/query/query_solution.cpp:300: FORWARD_NULL 122808 Calling "this->_root.operator bool()" implies that "this->_root" might be null-like.
/src/mongo/db/query/query_solution.cpp:305: FORWARD_NULL 122808 Attempting to access the managed object of an empty smart pointer "this->_root".



 Comments   
Comment by Githook User [ 27/Jan/23 ]

Author:

{'name': 'Alexander Ignatyev', 'email': 'alexander.ignatyev@mongodb.com', 'username': 'aligusnet'}

Message: SERVER-68823 Require non-null root value of QuerySolutionNode
Branch: master
https://github.com/mongodb/mongo/commit/b5373b13aa038785bedfc92c14f368692e39b4ed

Generated at Thu Feb 08 06:11:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.