summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qurl.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-06-28 11:21:00 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2011-06-28 15:34:12 +0200
commitbe3bd368485d373e63b3e4ff5c7db2da1d119feb (patch)
tree493096d0cd1466eae8538a99ee6f3e49897f4a94 /src/corelib/io/qurl.cpp
parent7590cfcea9d40e59af8edd7cdd3d11ffbc5aaa04 (diff)
Fix invalid read in QUrl::removeAllEncodedQueryItems
The remove will detach the string making the query pointer invalid. Note: the "test3" case is commented out because it does not remove the & at the end, and i do not want to enforce this behaviour in the test Task-number: QTBUG-20065 Change-Id: I195c5c3b468f46c797c7c4f8075303f2b1f4724c Reviewed-on: http://codereview.qt.nokia.com/822 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> (cherry picked from commit 2dd90a27a82289a5088b929c3bd27c1fd05967f6) Conflicts: tests/auto/qurl/tst_qurl.cpp
Diffstat (limited to 'src/corelib/io/qurl.cpp')
-rw-r--r--src/corelib/io/qurl.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 881365678f..d5510095e7 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -5466,6 +5466,7 @@ void QUrl::removeAllEncodedQueryItems(const QByteArray &key)
if (end < d->query.size())
++end; // remove additional '%'
d->query.remove(pos, end - pos);
+ query = d->query.constData(); //required if remove detach;
} else {
pos = end + 1;
}