Bug 707620 - Division by zero in fz_new_pixmap_from_float_data()
Summary: Division by zero in fz_new_pixmap_from_float_data()
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: 1.24.0
Hardware: PC Linux
: P2 normal
Assignee: MuPDF bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-28 13:11 UTC by Sebastian Rasmussen
Modified: 2024-03-16 17:34 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Rasmussen 2024-02-28 13:11:54 UTC
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-51103

https://github.com/dongyuma/sox-defects/blob/main/mupdf-defects.md#2-a-floating-point-exception-divide-by-zero-issue-was-discovered-in-mupdf-in-functon-fz_new_pixmap_from_float_data-of-pixmapc-in-line-1330

A floating point exception (divide-by-zero) vulnerability was discovered in mupdf 1.23.4 in functon fz_new_pixmap_from_float_data() of pixmap.c.
Comment 1 Sebastian Rasmussen 2024-03-01 15:08:58 UTC
Fixed in

commit f1b5f87edd2675d5c79301e4ef2e1139f67f904b
Author: Sebastian Rasmussen <sebras@gmail.com>
Date:   Wed Feb 28 21:08:56 2024 +0800

    Bug 707620: Check dimensions of float sample conversion buffer.
    
    This is implicitly done by allocating the destination pixmap, which
    restricts both dimensions and number of components of the image.
    
    Also ensure that the number of samples computation does not overflow,
    and consistently use size_t instead of int for buffer sizes/indexes.
    
    This fixes CVE-2023-51103.