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

Zfile write safety #3670

Merged
merged 1 commit into from
Nov 15, 2022
Merged

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Nov 14, 2022

When writing a zfile, anything that causes open() to fail will leave m_tilebuffer at 0 size. Subsequent calls to write_tiles, and also to close (which cleans up unwritten parts of the buffer at the end) did not check for this condition and would access out of bounds memory.

While I was in there, I converted the zfile.cpp error messages to the new formatting convention.

When writing a zfile, anything that causes open() to fail will leave
m_tilebuffer at 0 size. Subsequent calls to write_tiles, and also
to close (which cleans up unwritten parts of the buffer at the end)
did not check for this condition and would access out of bounds memory.

While I was in there, I converted the zfile.cpp error messages to the
new formatting convention.
@lgritz lgritz merged commit b48f065 into AcademySoftwareFoundation:master Nov 15, 2022
@lgritz lgritz deleted the lg-zfile branch November 15, 2022 03:22
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Nov 15, 2022
When writing a zfile, anything that causes open() to fail will leave
m_tilebuffer at 0 size. Subsequent calls to write_tiles, and also
to close (which cleans up unwritten parts of the buffer at the end)
did not check for this condition and would access out of bounds memory.

While I was in there, I converted the zfile.cpp error messages to the
new formatting convention.

Fixes TALOS-2022-1657
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