[JAVA-4236] Test serialization of BSON with embedded null bytes in strings Created: 15/Jul/21 Updated: 28/Oct/23 Resolved: 24/Sep/21 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | BSON, Test Coverage |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Backlog - Core Eng Program Management Team | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | spec-compliance | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Quarter: | FY22Q3 | ||||
| Documentation Changes: | Not Needed | ||||
| Description |
|
Downstream changes: drivers should sync BSON corpus spec tests with mongodb/specifications@ff5d91f. Specifically:
Existing language in the spec was also relaxed to no longer require drivers to successfully parse parseErrors tests in binary.json and top.json with a non-Extended JSON parser (to check for general JSON syntax errors). Also, an allowance was made for drivers that parse Extended JSON directly into language types (with regard to evaluating parseErrors). Per We should add spec or prose tests to verify BSON C strings with embedded null bytes are rejected when serialized. |
| Comments |
| Comment by Githook User [ 24/Sep/21 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}Message: Test for null byte in BSON cstring (#786) The driver already has the necessary checks One functional change to note though: this commit does remove the null byte check in BsonDocument#put, instead relying on BsonBinaryWriter's null byte checking in cstrings. This is consistent with the lack of null byte checks in org.bson.Document and BsonRegularExpression, as well as other drivers that use plain old dictionaries to represent BSON.
|