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

guard against null errors #144

Merged
merged 1 commit into from
Feb 8, 2025
Merged

Conversation

jraymakers
Copy link
Contributor

Fix a seg fault that can occur a C API function returns an error without creating a result. We need to initialize the result's internal data to nullptr, and also handle when duckdb_result_error returns nullptr. See #142 for the scenario in which this was discovered.

It's hard to add a unit test for this because the known case where this can occur is nondeterministic. I added a test that I used to manually repro and verify the fix, but it's skipped by default because of the nondeterminism.

@jraymakers jraymakers merged commit a2c89ad into main Feb 8, 2025
5 checks passed
@jraymakers jraymakers deleted the jray/guard-against-null-errors branch February 8, 2025 20:38
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