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

fix(c/driver/postgresql): Check if statement was released in stream reader #823

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jorisvandenbossche
Copy link
Member

This came up experimenting in #702. This patch seems to protect from segfaults when reading from a stream when the statement was already closed (AdbcStatementRelease was called).
Is that something we want to add? (and is it a proper way to achieve it?)

@lidavidm
Copy link
Member

I'm not sure this is worth doing; isn't it already a use-after-free? The fact that the memory happens to still be around is just a detail.

Possibly the statement should track whether a stream is still open and prevent release instead (converting a use-after-free into a possible leak)

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