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

Catch potential null pointers returned by Dataset::spatial_ref #540

Conversation

weiznich
Copy link
Contributor

@weiznich weiznich commented May 21, 2024

This otherwise hits an assertion in gdal debug builds for the OSRClone method

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

See https://github.com/OSGeo/gdal/blob/master/ogr/ogrspatialreference.cpp#L1406 for the relevant assertion in gdal

@lnicola
Copy link
Member

lnicola commented May 21, 2024

Can you also add an assert! to SpatialRef::from_c_obj, since its argument must be a valid pointer?

@weiznich weiznich force-pushed the fix/null_ptr_in_dataset_get_spatial_ref branch from 329a776 to 2131b78 Compare May 21, 2024 14:07
src/dataset.rs Outdated Show resolved Hide resolved
This otherwise hits an assertion in gdal debug builds for the OSRClone method
@weiznich weiznich force-pushed the fix/null_ptr_in_dataset_get_spatial_ref branch from 2131b78 to d2415a5 Compare May 21, 2024 14:12
@lnicola
Copy link
Member

lnicola commented May 21, 2024

Thanks, will merge once GHA comes back up.

@lnicola lnicola merged commit 19c5104 into georust:master May 22, 2024
9 checks passed
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.

None yet

2 participants