A test in the Swift driver kaitlin.mahar wrote crashes with a null pointer access in bson_init_from_json:
func testFailure() throws { // this works fine let extjson1 = "{\"a\" : [{\"$numberInt\": \"10\"}]}".data(using: .utf8)! let res1 = try Document(fromJSON: extjson1) print(res1) // this crashes let extjson2 = "{\"x\" : { \"$binary\" : {\"base64\" : \"\", \"subType\" : \"00\"}}}".data(using: .utf8)! let res2 = try Document(fromJSON: extjson2) print(res2) }
Kaitlin is able to reproduce this using 1.10 but not in 1.9 on macOS. This seems like an issue with the C driver. I couldn't reproduce the crash on Linux, nor from calling bson_init_from_json with the same arguments directly in the C driver. But I have not yet tested the Swift test on macOS yet.
- is related to
-
CDRIVER-2693 Segfault in bson_b64_pton parsing valid BSON
- Closed