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

BMP output safety #3673

Merged
merged 1 commit into from
Nov 16, 2022
Merged

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Nov 15, 2022

In open(), check for non-zero image offsets, which is not supported by BMP, and issue an error if found. If the spec passed in has nonzero spec.y, other code in the write functions would fail because they assumed spec.y == 0 and could therefore access memory incorrectly.

More generally, also put checks in the write functions that issue errors and take early outs if they find that they are called on a BMPOutput that is not currently open, for example if open() fails but the user doesn't check the return codes and proceeds to call the write functions anyway.

This addresses 1653

In open(), check for non-zero image offsets, which is not supported by
BMP, and issue an error if found. If the spec passed in has nonzero
spec.y, other code in the write functions would fail because they
assumed spec.y == 0 and could therefore access memory incorrectly.

More generally, also put checks in the write functions that issue
errors and take early outs if they find that they are called on a
BMPOutput that is not currently open, for example if open() fails but
the user doesn't check the return codes and proceeds to call the write
functions anyway.

This addresses 1653
@lgritz lgritz merged commit 4b22cf4 into AcademySoftwareFoundation:master Nov 16, 2022
@lgritz lgritz deleted the lg-bmpout branch November 16, 2022 20:08
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Nov 20, 2022
In open(), check for non-zero image offsets, which is not supported by
BMP, and issue an error if found. If the spec passed in has nonzero
spec.y, other code in the write functions would fail because they
assumed spec.y == 0 and could therefore access memory incorrectly.

More generally, also put checks in the write functions that issue
errors and take early outs if they find that they are called on a
BMPOutput that is not currently open, for example if open() fails but
the user doesn't check the return codes and proceeds to call the write
functions anyway.

This addresses TALOS-2022-1653 / CVE-2022-43594-CVE-2022-43595
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