-
Notifications
You must be signed in to change notification settings - Fork 94
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 use-after-free in Dataset::close
#420
Conversation
0598227
to
8bea21e
Compare
Dataset::close
8bea21e
to
6e87286
Compare
6e87286
to
ef3c562
Compare
ef3c562
to
59d7f6e
Compare
@@ -174,6 +174,7 @@ impl GeoTransformEx for GeoTransform { | |||
#[derive(Debug)] | |||
pub struct Dataset { | |||
c_dataset: GDALDatasetH, | |||
closed: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also have a wrapper around c_dataset
and use ManuallyDrop
on that instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ManuallyDrop
sounds nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I switched to ManuallyDrop
in 2e4b75e, but I'm not sure it's much better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scratch that, it doesn't really work, because the inner type's drop
still runs, and we can't get the return value of GDALClose
out of there. I'll revert to the previous version.
e181682
to
59d7f6e
Compare
r? @jdroenner |
sorry i forgot to merge this. Should we create a new release tomorrow? |
I might not be around tomorrow, but please do, if you can. I'd also yank the current version. |
CHANGES.md
if knowledge of this change could be valuable to users.