aboutsummaryrefslogtreecommitdiffstats
path: root/x11-toolkits
diff options
context:
space:
mode:
authorrakuco <rakuco@FreeBSD.org>2015-03-05 07:06:13 +0800
committerrakuco <rakuco@FreeBSD.org>2015-03-05 07:06:13 +0800
commit86377328c52a11b94d5af8f0289f66b458e087bd (patch)
treeb04c5ecbcd8f03dd3d88edad5ca494c1a600f013 /x11-toolkits
parent48f25ea89108855405293615df356aa48f1982b2 (diff)
downloadfreebsd-ports-gnome-86377328c52a11b94d5af8f0289f66b458e087bd.tar.gz
freebsd-ports-gnome-86377328c52a11b94d5af8f0289f66b458e087bd.tar.zst
freebsd-ports-gnome-86377328c52a11b94d5af8f0289f66b458e087bd.zip
Add patch for CVE-2015-0295, DoS vulnerability in the BMP image handler.
MFH: 2015Q1 Security: c9c3374d-c2c1-11e4-b236-5453ed2e2b49
Diffstat (limited to 'x11-toolkits')
-rw-r--r--x11-toolkits/qt4-gui/Makefile2
-rw-r--r--x11-toolkits/qt4-gui/files/patch-CVE-2015-029534
-rw-r--r--x11-toolkits/qt5-gui/Makefile2
-rw-r--r--x11-toolkits/qt5-gui/files/patch-CVE-2015-029537
4 files changed, 73 insertions, 2 deletions
diff --git a/x11-toolkits/qt4-gui/Makefile b/x11-toolkits/qt4-gui/Makefile
index cec41e89eb6d..be8ed9f90995 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 52216e5c0dc8..61b0f87973d3 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;