Skip to content

CDRIVER-5754 always write output on error in bson_validate_with_error_and_offset #1767

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

Merged
4 commits merged into from
Oct 15, 2024

Conversation

ghost
Copy link

@ghost ghost commented Oct 12, 2024

This fixes an edge case in bson_validate_with_error_and_offset that would cause unexpectedly uninitialized output parameters when a failure occurs at offset zero.

Includes the test case from CDRIVER-5754, now passing.

Micah Scott added 3 commits October 11, 2024 17:22
the implementation fails to write its out parameters when an error
occurs at the first byte, which can happen if the header is truncated.
@ghost ghost requested a review from kevinAlbs October 14, 2024 18:50
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find! LGTM with a test suggestion.

After merging to master, I suggest cherry-picking to the r1.28 branch to include this fix in the next 1.28 release.

@ghost ghost merged commit 4b22616 into mongodb:master Oct 15, 2024
8 of 10 checks passed
ghost pushed a commit that referenced this pull request Oct 15, 2024
…_and_offset (#1767)

* bson_validate_with_error_and_offset: write outputs when err_offset==0
* regression test, test_bson_validate_with_error_and_offset

---------

Co-authored-by: Kevin Albertson <[email protected]>
This pull request was closed.
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.

1 participant