diff options
author | Treeve Jelbert | 2007-05-06 11:48:59 +0200 |
---|---|---|
committer | Eric Sandall | 2007-05-07 17:28:57 -0700 |
commit | d4c3793f035ebc739df67b00c2a88d6ea30d681f (patch) | |
tree | 907336bcda879b8d262af8618bec52359d184c79 | |
parent | 926a6dc23ab1fe415de176291fcf46a6ff0f2b46 (diff) |
qt4 - fix bug #13762
(cherry picked from commit 7b8dfb93b3af367207f65c75bf404e2065729467)
Conflicts:
x11-toolkits/qt4/DETAILS
x11-toolkits/qt4/HISTORY
x11-toolkits/qt4/PRE_BUILD
-rwxr-xr-x | x11-toolkits/qt4/DETAILS | 1 | ||||
-rw-r--r-- | x11-toolkits/qt4/HISTORY | 6 | ||||
-rwxr-xr-x | x11-toolkits/qt4/PRE_BUILD | 9 | ||||
-rw-r--r-- | x11-toolkits/qt4/Qt-4.2.3-UTF-8-fix.diff | 133 |
4 files changed, 149 insertions, 0 deletions
diff --git a/x11-toolkits/qt4/DETAILS b/x11-toolkits/qt4/DETAILS index 10af8de633..64c6013753 100755 --- a/x11-toolkits/qt4/DETAILS +++ b/x11-toolkits/qt4/DETAILS @@ -6,6 +6,7 @@ SOURCE_DIRECTORY=$BUILD_DIRECTORY/qt-x11-opensource-src-$VERSION SOURCE_URL[0]=ftp://ftp.trolltech.com/qt/source/$SOURCE SOURCE_URL[1]=ftp://ftp.silug.org/pub/qt/source/$SOURCE SOURCE_URL[2]=ftp://ftp.planetmirror.com.au/pub/trolltech/qt/source/$SOURCE + SECURITY_PATCH=1 WEB_SITE=http://www.trolltech.com/qt/x11.html ENTERED=20020410 LICENSE[0]=GPL diff --git a/x11-toolkits/qt4/HISTORY b/x11-toolkits/qt4/HISTORY index 4d03409087..e98b4b28db 100644 --- a/x11-toolkits/qt4/HISTORY +++ b/x11-toolkits/qt4/HISTORY @@ -1,3 +1,9 @@ +2007-05-05 Treeve Jelbert <treeve@sourcemage.org> + * DETAILS: SECURITY_PATCH++ + * Qt-4.2.3-UTF-8-fix.diff: added + * PRE_BUILD: apply patch + fixes bug #13762 + 2007-03-28 Treeve Jelbert <treeve@sourcemage.org> * TRIGGERS: add check on postgresql fixes bug #13662 diff --git a/x11-toolkits/qt4/PRE_BUILD b/x11-toolkits/qt4/PRE_BUILD index ff35dad486..ac88dacbc1 100755 --- a/x11-toolkits/qt4/PRE_BUILD +++ b/x11-toolkits/qt4/PRE_BUILD @@ -1,5 +1,14 @@ default_pre_build && cd $SOURCE_DIRECTORY && + +# apply patches +patch -po < $SPELL_DIRECTORY/Qt-4.2.3-UTF-8-fix.diff && + +# add better optimisation flags +# -O2 gives segmentation fault in moc when building tools +sed -i "s|-O2|${CFLAGS/-O3/-O2}|" mkspecs/common/g++.conf \ + mkspecs/linux-cxx/qmake.conf && + # remove big direcotries if [ $QT_DOC = n ];then rm -r doc demos examples && diff --git a/x11-toolkits/qt4/Qt-4.2.3-UTF-8-fix.diff b/x11-toolkits/qt4/Qt-4.2.3-UTF-8-fix.diff new file mode 100644 index 0000000000..098f4d6c02 --- /dev/null +++ b/x11-toolkits/qt4/Qt-4.2.3-UTF-8-fix.diff @@ -0,0 +1,133 @@ +--- src/corelib/codecs/qutfcodec.cpp Fri Mar 30 06:06:30 2007
++++ src/corelib/codecs/qutfcodec.cpp Fri Mar 30 06:06:30 2007
+@@ -117,15 +117,19 @@
+ bool headerdone = false;
+ QChar replacement = QChar::ReplacementCharacter;
+ int need = 0;
++ int error = -1;
+ uint uc = 0;
++ uint min_uc = 0;
+ if (state) {
+ if (state->flags & IgnoreHeader)
+ headerdone = true;
+ if (state->flags & ConvertInvalidToNull)
+ replacement = QChar::Null;
+ need = state->remainingChars;
+- if (need)
++ if (need) {
+ uc = state->state_data[0];
++ min_uc = state->state_data[1];
++ }
+ }
+ if (!headerdone && len > 3
+ && (uchar)chars[0] == 0xef && (uchar)chars[1] == 0xbb && (uchar)chars[2] == 0xbf) {
+@@ -142,7 +146,7 @@
+ int invalid = 0;
+
+ for (int i=0; i<len; i++) {
+- ch = *chars++;
++ ch = chars[i];
+ if (need) {
+ if ((ch&0xc0) == 0x80) {
+ uc = (uc << 6) | (ch & 0x3f);
+@@ -153,14 +157,27 @@
+ uc -= 0x10000;
+ unsigned short high = uc/0x400 + 0xd800;
+ unsigned short low = uc%0x400 + 0xdc00;
++
++ // resize if necessary
++ long where = qch - result.unicode();
++ if (where + 2 >= result.size()) {
++ result.resize(where + 2);
++ qch = result.data() + where;
++ }
++
+ *qch++ = QChar(high);
+ *qch++ = QChar(low);
++ } else if ((uc < min_uc) || (uc >= 0xd800 && uc <= 0xdfff) || (uc >= 0xfffe)) {
++ // error
++ *qch++ = QChar::ReplacementCharacter;
++ ++invalid;
+ } else {
+ *qch++ = uc;
+ }
+ }
+ } else {
+ // error
++ i = error;
+ *qch++ = QChar::ReplacementCharacter;
+ ++invalid;
+ need = 0;
+@@ -171,12 +188,22 @@
+ } else if ((ch & 0xe0) == 0xc0) {
+ uc = ch & 0x1f;
+ need = 1;
++ error = i;
++ min_uc = 0x80;
+ } else if ((ch & 0xf0) == 0xe0) {
+ uc = ch & 0x0f;
+ need = 2;
++ error = i;
++ min_uc = 0x800;
+ } else if ((ch&0xf8) == 0xf0) {
+ uc = ch & 0x07;
+ need = 3;
++ error = i;
++ min_uc = 0x10000;
++ } else {
++ // error
++ *qch++ = QChar::ReplacementCharacter;
++ ++invalid;
+ }
+ }
+ }
+@@ -187,6 +214,7 @@
+ if (headerdone)
+ state->flags |= IgnoreHeader;
+ state->state_data[0] = need ? uc : 0;
++ state->state_data[1] = need ? min_uc : 0;
+ }
+ return result;
+ }
+
+--- src/corelib/tools/qstring.cpp Fri Mar 30 06:06:30 2007
++++ src/corelib/tools/qstring.cpp Fri Mar 30 06:06:30 2007
+@@ -3342,6 +3342,7 @@
+ result.resize(size); // worst case
+ ushort *qch = result.d->data;
+ uint uc = 0;
++ uint min_uc = 0;
+ int need = 0;
+ int error = -1;
+ uchar ch;
+@@ -3359,6 +3360,12 @@
+ ushort low = uc%0x400 + 0xdc00;
+ *qch++ = high;
+ *qch++ = low;
++ } else if ((uc < min_uc) || (uc >= 0xd800 && uc <= 0xdfff) || (uc >= 0xfffe)) {
++ // overlong seqence, UTF16 surrogate or BOM
++ i = error;
++ qch = addOne(qch, result);
++ *qch++ = 0xdbff;
++ *qch++ = 0xde00 + ((uchar)str[i]);
+ } else {
+ *qch++ = uc;
+ }
+@@ -3381,14 +3388,17 @@
+ uc = ch & 0x1f;
+ need = 1;
+ error = i;
++ min_uc = 0x80;
+ } else if ((ch & 0xf0) == 0xe0) {
+ uc = ch & 0x0f;
+ need = 2;
+ error = i;
++ min_uc = 0x800;
+ } else if ((ch&0xf8) == 0xf0) {
+ uc = ch & 0x07;
+ need = 3;
+ error = i;
++ min_uc = 0x10000;
+ } else {
+ // Error
+ qch = addOne(qch, result);
|