Skip to content

guard against null errors#144

Merged
jraymakers merged 1 commit intomainfrom
jray/guard-against-null-errors
Feb 8, 2025
Merged

guard against null errors#144
jraymakers merged 1 commit intomainfrom
jray/guard-against-null-errors

Conversation

@jraymakers
Copy link
Copy Markdown
Collaborator

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