After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 150601 - Bad BMP files can cause gdk-pixbuf loader to sit in an infinite loop
Bad BMP files can cause gdk-pixbuf loader to sit in an infinite loop
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2004-08-20 00:16 UTC by Manish Singh
Modified: 2010-07-10 04:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Problem bmp file (3.05 KB, image/bmp)
2004-08-20 00:17 UTC, Manish Singh
  Details
Simple patch to make the bad bmp file not cause an infinite loop (535 bytes, patch)
2004-08-20 00:19 UTC, Manish Singh
none Details | Review

Description Manish Singh 2004-08-20 00:16:58 UTC
http://scary.beasts.org/security/CESA-2004-004.txt details some bugs in the qt
bmp parser. The referenced bad.bmp sends the gdk-pixbuf bmp loader into an
infinite loop. It looks like 1c is also a problem in the loader, but I'm not sure.
Comment 1 Manish Singh 2004-08-20 00:17:41 UTC
Created attachment 30767 [details]
Problem bmp file
Comment 2 Manish Singh 2004-08-20 00:19:17 UTC
Created attachment 30768 [details] [review]
Simple patch to make the bad bmp file not cause an infinite loop

This lets the file load normally for me, but I really don't know much about the
bmp format, so I have no idea if this is correct.
Comment 3 Mark Cox 2004-08-20 14:46:44 UTC
As this is a different flaw to Qt it needs a separate CVE name (even though it
shares the same trigger);  CAN-2004-0753
Comment 4 Owen Taylor 2004-08-20 19:04:52 UTC
Your patch looks correct to me, with the caveat that we perhaps should
be picker than we are now (just filed bug 150648. Also bug 150664
that I noticed when looking at the code.)

Added a big comment:

        /* context->compr.y might be past the last line because we are
         * on padding past the end of a valid data, or we might have hit
         * out-of-bounds data. Either way we just eat-and-ignore the
         * rest of the file. Doing the check only here and not when
         * we change y below is fine since BufferSize is always 2 here
         * and the BMP file format always starts new data on 16-bit
         * boundaries.
         */

Fri Aug 20 11:59:10 2004  Owen Taylor  <otaylor@redhat.com>
 
        * io-bmp.c: Fix infinite loop that can occur for bad
        image data (#150601, Chris Evans, Manish Singh)