Summary: | Division by zero in pnm_binary_read_image() | ||
---|---|---|---|
Product: | MuPDF | Reporter: | Sebastian Rasmussen <sebastian.rasmussen> |
Component: | mupdf | Assignee: | MuPDF bugs <mupdf-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 1.24.0 | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- |
Description
Sebastian Rasmussen
2024-02-28 13:13:11 UTC
Fixed in commit 0c06a4e51519515615f6ab2d5b1f25da6771e1f4 Author: Sebastian Rasmussen <sebras@gmail.com> Date: Fri Mar 1 22:05:33 2024 +0800 Bug 707621: Add assert ensuring that there is > 0 components. CVE-2023-51104 reports that pnm_binary_read_image() may end up in a division by zero. After deducing that the issue originates from clang's scan-build-17 and studying its reported issues, the source code of pnm_read_image() and pnm_binary_read_image() were analyzed. What scan-build-17 fails to realize is that pnm_read_image() guarantees that the number of components in the passed colorspace is either 1 or 3. The best way to avoid getting similar CVEs is to add a redundant assert() for the number of components. After this scan-build-17's reports about division by zero in pnm_binary_read_image() disappear and thus this eliminate CVE-2023-51104. |