Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PYTHON-4323 Add regression test for out-of-bounds read when decoding invalid bson #1693

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

ShaneHarvey
Copy link
Member

https://jira.mongodb.org/browse/PYTHON-4323

Here's how this test fails on pymongo 4.6.0:

FAIL: test_bad_code (__main__.TestBSON.test_bad_code)
----------------------------------------------------------------------
bson.errors.InvalidBSON: Detected unknown BSON type b'\x00' for fieldname '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'. Are you using the latest driver version?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/shane/git/mongo-python-driver/test/test_bson.py", line 516, in test_bad_code
    with self.assertRaisesRegex(InvalidBSON, "invalid") as ctx:
AssertionError: "invalid" does not match "Detected unknown BSON type b'\x00' for fieldname '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'. Are you using the latest driver version?"

@ShaneHarvey ShaneHarvey requested review from NoahStapp and removed request for blink1073 June 19, 2024 00:36
@ShaneHarvey ShaneHarvey merged commit 77087dd into mongodb:master Jun 20, 2024
32 of 34 checks passed
@ShaneHarvey ShaneHarvey deleted the PYTHON-4323 branch June 20, 2024 16:57
ShaneHarvey added a commit to ShaneHarvey/mongo-python-driver that referenced this pull request Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants