Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BMP output safety (AcademySoftwareFoundation#3673)
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
- Loading branch information