[MONGOCRYPT-212] `kms_request_get_canonical` can return NULL and lead to segfault Created: 29/Nov/19  Updated: 28/Oct/23  Resolved: 02/Dec/19

Status: Closed
Project: Libmongocrypt
Component/s: kms_message
Affects Version/s: None
Fix Version/s: 1.0.1

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


 Description   

This method can possibly return NULL (in our unit tests because we stub out the implementation with one that returns false), but the library does not check for that value before attempting to operate on the string a few lines down, leading to a segfault



 Comments   
Comment by Githook User [ 02/Dec/19 ]

Author:

{'name': 'Matt Broadstone', 'username': 'mbroadst', 'email': 'mbroadst@mongodb.com'}

Message: MONGOCRYPT-212 add null check for `kms_request_get_canonical`

This method can return `NULL`, so a null check is required in
order to prevent segfaults.
Branch: master
https://github.com/mongodb/libmongocrypt/commit/a0848f95b6e9ac9398bb4aff3be6a6436c215e31

Comment by Matt Broadstone [ 29/Nov/19 ]

https://github.com/mongodb/libmongocrypt/pull/82

Comment by Githook User [ 29/Nov/19 ]

Author:

{'email': 'mbroadst@mongodb.com', 'name': 'Matt Broadstone', 'username': 'mbroadst'}

Message: MONGOCRYPT-212 add null check for `kms_request_get_canonical`

This method can return `NULL`, so a null check is required in
order to prevent segfaults.
Branch: MONGOCRYPT-212/fix-kms-message-segfault
https://github.com/mongodb/libmongocrypt/commit/81529d3e5462e1dc11feec2daf876f0964563dc4

Generated at Thu Feb 08 09:08:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.