[SERVER-64474] Coverity analysis defect 121890: Dereference null return value Created: 14/Mar/22  Updated: 29/Oct/23  Resolved: 15/Mar/22

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

Type: Bug Priority: Minor - P4
Reporter: Coverity Collector User Assignee: Rui Liu
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2022-03-14 at 11.19.40 AM.png    
Issue Links:
Problem/Incident
is caused by SERVER-63572 Index SBEPlan: Translate EqLookup for... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QE 2022-03-21
Participants:

 Description   

Dereference null return value

If the function actually returns a null value, a null pointer dereference will occur. Return value of function which returns null is dereferenced without checking
/src/mongo/db/query/sbe_stage_builder_lookup.cpp:284: NULL_RETURNS 121890 Assigning: "indexDescriptor" = "nullptr" return value from "findIndexByName".



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

Author:

{'name': 'Rui Liu', 'email': 'rui.liu@mongodb.com', 'username': 'lriuui0x0'}

Message: SERVER-64474 Add null pointer assertion for index descriptor access during index join
Branch: master
https://github.com/mongodb/mongo/commit/5bc5790be407657748307f20404af62de62cba31

Comment by Githook User [ 14/Mar/22 ]

Author:

{'name': 'Rui Liu', 'email': 'rui.liu@mongodb.com', 'username': 'lriuui0x0'}

Message: SERVER-64474 Add null pointer assertion for index descriptor access during index join
Branch: master
https://github.com/mongodb/mongo/commit/90caba6b07d4b606f6d4641a398a529926aba2ce

Comment by Rui Liu [ 14/Mar/22 ]

kyle.suarez Looks like we should add an assertion there (index should always be there since we picked it for the index join), I can take the ticket.

Comment by Kyle Suarez [ 14/Mar/22 ]

FYI rui.liu, looks like it's complaining since findIndexByName() could technically return null.

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