[SERVER-74330] Prevent nullptr access in checkCollectionOptions uassert Created: 23/Feb/23  Updated: 29/Oct/23  Resolved: 24/Feb/23

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

Type: Bug Priority: Major - P3
Reporter: Jennifer Peshansky (Inactive) Assignee: Jennifer Peshansky (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
is caused by SERVER-60064 Make create command idempotent on mongod Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:
Linked BF Score: 155

 Description   

This can be reproduced by running:

db.runCommand(

{ create: 'view', viewOn: 'coll' }

);

db.runCommand({
create: 'view',
viewOn: 'coll',
collation:

{ locale: 'en' }

});

The first command attempts to create a view, but it fails with the error code OptionNotSupportedOnView. The second command should fail with the same error code, but instead segfaults inside checkCollectionOptions while attempting to raise this uassert.

Collation is deliberately represented as a nullptr when there have been no special collation options set.

This can be fixed by checking for a nullptr before raising the uassert.



 Comments   
Comment by Githook User [ 24/Feb/23 ]

Author:

{'name': 'Jennifer Peshansky', 'email': 'jennifer.peshansky@mongodb.com', 'username': 'jenniferpeshansky'}

Message: SERVER-74330 Prevent nullptr access in checkCollectionOptions uassert
Branch: master
https://github.com/mongodb/mongo/commit/77b0bcf3802e8a3f3869eea0b29a5b3b975c5bb6

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