Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
libqt5-qtbase.620
libqt5-Fix-a-division-by-zero-processing-malfor...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libqt5-Fix-a-division-by-zero-processing-malformed-BMP.patch of Package libqt5-qtbase.620
From 661f6bfd032dacc62841037732816a583640e187 Mon Sep 17 00:00:00 2001 From: "Richard J. Moore" <rich@kde.org> Date: Sat, 21 Feb 2015 17:43:21 +0000 Subject: [PATCH] Fix a division by zero when processing malformed BMP files. This fixes a division by 0 when processing a maliciously crafted BMP file. No impact beyond DoS. Task-number: QTBUG-44547 Change-Id: Ifcded2c0aa712e90d23e6b3969af0ec3add53973 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> --- src/gui/image/qbmphandler.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/src/gui/image/qbmphandler.cpp +++ b/src/gui/image/qbmphandler.cpp @@ -322,12 +322,20 @@ static bool read_dib_body(QDataStream &s } } else if (comp == BMP_BITFIELDS && (nbits == 16 || nbits == 32)) { red_shift = calc_shift(red_mask); + if (((red_mask >> red_shift) + 1) == 0) + return false; red_scale = 256 / ((red_mask >> red_shift) + 1); green_shift = calc_shift(green_mask); + if (((green_mask >> green_shift) + 1) == 0) + return false; green_scale = 256 / ((green_mask >> green_shift) + 1); blue_shift = calc_shift(blue_mask); + if (((blue_mask >> blue_shift) + 1) == 0) + return false; blue_scale = 256 / ((blue_mask >> blue_shift) + 1); alpha_shift = calc_shift(alpha_mask); + if (((alpha_mask >> alpha_shift) + 1) == 0) + return false; alpha_scale = 256 / ((alpha_mask >> alpha_shift) + 1); } else if (comp == BMP_RGB && (nbits == 24 || nbits == 32)) { blue_mask = 0x000000ff;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor