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

Throw if open file with EXV_ENABLE_FILESYSTEM off #3020

Merged
merged 2 commits into from
Aug 4, 2024

Conversation

jim-easterbrook
Copy link
Contributor

If ImageFactory::createIo() is called with a file path and has been built with EXV_ENABLE_FILESYSTEM off it returns a NULL pointer. ImageFactory::open() then calls io->open() on this pointer, causing a segfault. The documentation of ImageFactory::createIo does not say it can return a NULL pointer. This commit makes it throw an exception instead of returning a NULL pointer.

If ImageFactory::createIo() is called with a file path and has been
built with EXV_ENABLE_FILESYSTEM off it returns a NULL pointer.
ImageFactory::open() then calls io->open() on this pointer, causing a
segfault. The documentation of ImageFactory::createIo does not say it
can return a NULL pointer. This commit makes it throw an exception
instead of returning a NULL pointer.
src/image.cpp Outdated Show resolved Hide resolved
This can be thrown anywhere a file operation is not permitted because
exiv2 has been build with EXV_ENABLE_FILESYSTEM off.
@kmilos kmilos merged commit 5fb8c65 into Exiv2:0.28.x Aug 4, 2024
56 of 57 checks passed
@kmilos kmilos added the forward-to-main Forward changes in a 0.28.x PR to main with Mergify label Aug 4, 2024
@kmilos kmilos added this to the v0.28.4 milestone Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forward-to-main Forward changes in a 0.28.x PR to main with Mergify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants