diff options
author | Raphael Kubo da Costa <rakuco@FreeBSD.org> | 2015-03-06 22:05:30 +0000 |
---|---|---|
committer | Raphael Kubo da Costa <rakuco@FreeBSD.org> | 2015-03-06 22:05:30 +0000 |
commit | 1f36381c019537a9cd8cd66257cde17249972ea8 (patch) | |
tree | be27d84612364395ad3a554574705034bbd82442 | |
parent | 9f2a4f6580225894390af982c711d32f2027a604 (diff) | |
download | ports-1f36381c019537a9cd8cd66257cde17249972ea8.tar.gz ports-1f36381c019537a9cd8cd66257cde17249972ea8.zip |
MFH: r380452
Add patch for CVE-2015-0295, DoS vulnerability in the BMP image handler.
Security: c9c3374d-c2c1-11e4-b236-5453ed2e2b49
Approved by: ports-secteam (delphij)
Notes
Notes:
svn path=/branches/2015Q1/; revision=380629
-rw-r--r-- | x11-toolkits/qt4-gui/Makefile | 2 | ||||
-rw-r--r-- | x11-toolkits/qt4-gui/files/patch-CVE-2015-0295 | 34 | ||||
-rw-r--r-- | x11-toolkits/qt5-gui/Makefile | 2 | ||||
-rw-r--r-- | x11-toolkits/qt5-gui/files/patch-CVE-2015-0295 | 37 |
4 files changed, 73 insertions, 2 deletions
diff --git a/x11-toolkits/qt4-gui/Makefile b/x11-toolkits/qt4-gui/Makefile index a85104eb6ffa..7731553304e3 100644 --- a/x11-toolkits/qt4-gui/Makefile +++ b/x11-toolkits/qt4-gui/Makefile @@ -3,7 +3,7 @@ PORTNAME= gui DISTVERSION= ${QT4_VERSION} -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= x11-toolkits PKGNAMEPREFIX= qt4- diff --git a/x11-toolkits/qt4-gui/files/patch-CVE-2015-0295 b/x11-toolkits/qt4-gui/files/patch-CVE-2015-0295 new file mode 100644 index 000000000000..46249856032c --- /dev/null +++ b/x11-toolkits/qt4-gui/files/patch-CVE-2015-0295 @@ -0,0 +1,34 @@ +commit e50aa2252cdd5cb53eef7d8c4503c7edff634f68 +Author: Richard J. Moore <rich@kde.org> +Date: Tue Feb 24 19:02:35 2015 +0000 + + 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. + + Backport of 661f6bfd032dacc62841037732816a583640e187 + + Task-number: QTBUG-44547 + Change-Id: I43f06e752b11cb50669101460902a82b885ae618 + Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> + +--- src/gui/image/qbmphandler.cpp ++++ src/gui/image/qbmphandler.cpp +@@ -319,10 +319,16 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int + } + } 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); + } else if (comp == BMP_RGB && (nbits == 24 || nbits == 32)) { + blue_mask = 0x000000ff; diff --git a/x11-toolkits/qt5-gui/Makefile b/x11-toolkits/qt5-gui/Makefile index 413351ebe2a2..d2376d941f54 100644 --- a/x11-toolkits/qt5-gui/Makefile +++ b/x11-toolkits/qt5-gui/Makefile @@ -2,7 +2,7 @@ PORTNAME= gui DISTVERSION= ${QT5_VERSION} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= x11-toolkits graphics PKGNAMEPREFIX= qt5- diff --git a/x11-toolkits/qt5-gui/files/patch-CVE-2015-0295 b/x11-toolkits/qt5-gui/files/patch-CVE-2015-0295 new file mode 100644 index 000000000000..5a32eb93b026 --- /dev/null +++ b/x11-toolkits/qt5-gui/files/patch-CVE-2015-0295 @@ -0,0 +1,37 @@ +commit 661f6bfd032dacc62841037732816a583640e187 +Author: Richard J. Moore <rich@kde.org> +Date: Sat Feb 21 17:43:21 2015 +0000 + + 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 ++++ src/gui/image/qbmphandler.cpp +@@ -314,12 +314,20 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int + } + } 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; |