aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlofi <lofi@FreeBSD.org>2007-09-18 16:19:55 +0800
committerlofi <lofi@FreeBSD.org>2007-09-18 16:19:55 +0800
commit4cb3fa6d1d999248e2d83f63bf2026cc977865b9 (patch)
tree010ad6da392b30c4c0c51765260df71a0f615586
parent4a826d139e6cd1fb8ac40f14c23e8f4bdaf52d78 (diff)
downloadfreebsd-ports-gnome-4cb3fa6d1d999248e2d83f63bf2026cc977865b9.tar.gz
freebsd-ports-gnome-4cb3fa6d1d999248e2d83f63bf2026cc977865b9.tar.zst
freebsd-ports-gnome-4cb3fa6d1d999248e2d83f63bf2026cc977865b9.zip
Fix potential vulnerability from an off-by-one error in the QUtf8Decoder
class. Security: CVS-2007-4137
-rw-r--r--devel/qt4-corelib/Makefile2
-rw-r--r--devel/qt4-corelib/files/patch-CVE-2007-413711
-rw-r--r--x11-toolkits/qt33/files/patch-utf8-bug-qt38
3 files changed, 18 insertions, 3 deletions
diff --git a/devel/qt4-corelib/Makefile b/devel/qt4-corelib/Makefile
index c98fe7b206ef..2ec4db79b5ad 100644
--- a/devel/qt4-corelib/Makefile
+++ b/devel/qt4-corelib/Makefile
@@ -8,7 +8,7 @@
PORTNAME= corelib
PORTVERSION= ${QT4_VERSION}
-PORTREVISION= 0
+PORTREVISION= 1
CATEGORIES?= devel
MASTER_SITES= ${MASTER_SITE_QT}
PKGNAMEPREFIX= qt4-
diff --git a/devel/qt4-corelib/files/patch-CVE-2007-4137 b/devel/qt4-corelib/files/patch-CVE-2007-4137
new file mode 100644
index 000000000000..e2bbdd06eb5b
--- /dev/null
+++ b/devel/qt4-corelib/files/patch-CVE-2007-4137
@@ -0,0 +1,11 @@
+--- src/corelib/codecs/qutfcodec.cpp
++++ src/corelib/codecs/qutfcodec.cpp
+@@ -140,7 +140,7 @@ void QUtf8Codec::convertToUnicode(QString *target, const char *chars, int len, C
+
+ int originalLength = target->length();
+ QString &result = *target;
+- result.resize(originalLength + len); // worst case
++ result.resize(originalLength + len + 1); // worst case
+ QChar *qch = result.data() + originalLength;
+ uchar ch;
+ int invalid = 0;
diff --git a/x11-toolkits/qt33/files/patch-utf8-bug-qt3 b/x11-toolkits/qt33/files/patch-utf8-bug-qt3
index 43e84a99f1e9..3657e8e92236 100644
--- a/x11-toolkits/qt33/files/patch-utf8-bug-qt3
+++ b/x11-toolkits/qt33/files/patch-utf8-bug-qt3
@@ -8,8 +8,12 @@
int need;
bool headerDone;
public:
-@@ -167,8 +168,9 @@
- result.setLength( len ); // worst case
+@@ -164,11 +165,12 @@
+ QString toUnicode(const char* chars, int len)
+ {
+ QString result;
+- result.setLength( len ); // worst case
++ result.setLength( len + 1 ); // worst case
QChar *qch = (QChar *)result.unicode();
uchar ch;
+ int error = -1;