[CDRIVER-4457] Dropping QE collection with nonexistent state collections & NULL error pointer causes segmentation fault Created: 16/Aug/22  Updated: 28/Oct/23  Resolved: 04/Oct/22

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.23.1

Type: Bug Priority: Major - P3
Reporter: Erwin Pe Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Summary

Dropping a QE-encrypted collection using mongoc_collection_drop(coll, NULL) results in a segmentation fault if any of the associated state collections (eg. ESC, ECC, and ECOC) do not exist. The cause is a NULL dereference on the error pointer in drop_with_opts_with_encryptedFields() when checking whether the attempt to drop the state collection failed with a MONGOC_SERVER_ERR_NS_NOT_FOUND.

Environment

libmongoc v1.22.1, compiled with -DENABLE_CLIENT_SIDE_ENCRYPTION=ON



 Comments   
Comment by Githook User [ 04/Oct/22 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-4457 fix NULL deref on QE collection drop (#1113)

Fixes a NULL dereference when mongoc_collection_drop is called with a NULL bson_error_t for a Queryable Encryption collection
Branch: r1.23
https://github.com/mongodb/mongo-c-driver/commit/9442032765654f4487901d040a4a7324dfb02027

Comment by Githook User [ 04/Oct/22 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-4457 fix NULL deref on QE collection drop (#1113)

Fixes a NULL dereference when mongoc_collection_drop is called with a NULL bson_error_t for a Queryable Encryption collection
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/d217ff83f852f14c9cb7b0e400b4ce983c2edf2e

Generated at Wed Feb 07 21:20:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.