[SERVER-48891] nullptr dereference on ViewCatalog in reIndex when Database does not exist Created: 16/Jun/20  Updated: 29/Oct/23  Resolved: 16/Jun/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.4.0-rc10, 4.2.9, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Louis Williams
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4, v4.2
Sprint: Execution Team 2020-06-29
Participants:
Linked BF Score: 19

 Description   

This is not safe, because the database is not guaranteed to exist, and ViewCatalog::get may return a nullptr.



 Comments   
Comment by Githook User [ 22/Jun/20 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-48891 reIndex should not lookup nonexistent database in ViewCatalog

(cherry picked from commit b9874b9c81e529e661b6615dd2ce5948e6db15bc)
(cherry picked from commit 8a69ffaf15ef093649090d6695227107d24ea666)
Branch: v4.2
https://github.com/mongodb/mongo/commit/6f8b2a7abc3899a2caf653843a8e41e0b69523c3

Comment by Githook User [ 16/Jun/20 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-48891 reIndex should not lookup nonexistent database in ViewCatalog

(cherry picked from commit b9874b9c81e529e661b6615dd2ce5948e6db15bc)
Branch: v4.4
https://github.com/mongodb/mongo/commit/8a69ffaf15ef093649090d6695227107d24ea666

Comment by Githook User [ 16/Jun/20 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-48891 reIndex should not lookup nonexistent database in ViewCatalog
Branch: master
https://github.com/mongodb/mongo/commit/b9874b9c81e529e661b6615dd2ce5948e6db15bc

Comment by Louis Williams [ 16/Jun/20 ]

This causes the server to crash in standalone mode if reIndex is run on a non-existent database.

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