summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2019-11-23 01:54:38 +0100
committerThiago Macieira <thiago.macieira@intel.com>2019-11-26 05:08:28 +0100
commit31e94dc96cf372db27d9a064e770180178f70156 (patch)
treec3bb18b5b6b286167ab885419c27fed17f2c6954 /src/corelib/codecs
parent9a82a290001ff720a084f57b67663949d34d4c9a (diff)
QGb18030Codec: fix out-of-bounds access when decoding surrogate pairs
This is already the second surrogate of the pair, there's no need to + +i. Fixes: QTBUG-80268 Change-Id: Ia2aa807ffa8a4c798425fffd15d9a48ee0ca8ed7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/codecs')
-rw-r--r--src/corelib/codecs/qgb18030codec.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/corelib/codecs/qgb18030codec.cpp b/src/corelib/codecs/qgb18030codec.cpp
index 4206eacb6f..ca15be1cea 100644
--- a/src/corelib/codecs/qgb18030codec.cpp
+++ b/src/corelib/codecs/qgb18030codec.cpp
@@ -107,7 +107,6 @@ QByteArray QGb18030Codec::convertFromUnicode(const QChar *uc, int len, Converter
if (high >= 0) {
if (uc[i].isLowSurrogate()) {
// valid surrogate pair
- ++i;
uint u = QChar::surrogateToUcs4(high, uc[i].unicode());
len = qt_UnicodeToGb18030(u, buf);
if (len >= 2) {