summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-06-28 11:21:00 +0200
committerQt by Nokia <qt-info@nokia.com>2011-06-28 12:10:30 +0200
commit2dd90a27a82289a5088b929c3bd27c1fd05967f6 (patch)
tree942ff26c4d77fde801cb458ad120741b22ef14d8 /src
parent563ec6c690e29d5efb24d0b63ac6c2e80a673db1 (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>
Diffstat (limited to 'src')
-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;
}