diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-03-22 17:59:05 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-03-23 11:03:40 (GMT) |
commit | 1831e7f802d1bdba33f320c21f29df02d647ead8 (patch) | |
tree | 4e794b5046b8155422a2dc5d28f5f3feaa4c9bc8 /src/network/kernel | |
parent | f31dfc682402396e35dffd8952eb5ced8f6b4030 (diff) | |
download | Qt-1831e7f802d1bdba33f320c21f29df02d647ead8.zip Qt-1831e7f802d1bdba33f320c21f29df02d647ead8.tar.gz Qt-1831e7f802d1bdba33f320c21f29df02d647ead8.tar.bz2 |
Ensure parameters of async function calls stay in scope
Calling symbian asynchronous functions with parameters on the stack,
even "in" parameters is unsafe. If the server is blocked on another
operation, then it will not read the parameters until later (at which
time the stack is invalid)
Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network/kernel')
-rw-r--r-- | src/network/kernel/qhostinfo_p.h | 4 | ||||
-rw-r--r-- | src/network/kernel/qhostinfo_symbian.cpp | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h index bff5fc4..71c191f 100644 --- a/src/network/kernel/qhostinfo_p.h +++ b/src/network/kernel/qhostinfo_p.h @@ -249,12 +249,16 @@ private: private: const QString iHostName; + QString iEncodedHostName; + TPtrC iHostNamePtr; RSocketServ& iSocketServ; RHostResolver iHostResolver; QSharedPointer<QNetworkSession> iNetworkSession; TNameEntry iNameResult; + TInetAddr IpAdd; + QHostAddress iAddress; QHostInfo iResults; diff --git a/src/network/kernel/qhostinfo_symbian.cpp b/src/network/kernel/qhostinfo_symbian.cpp index c969748..c1457fd 100644 --- a/src/network/kernel/qhostinfo_symbian.cpp +++ b/src/network/kernel/qhostinfo_symbian.cpp @@ -259,7 +259,6 @@ void QSymbianHostResolver::requestHostLookup() if (iAddress.setAddress(iHostName)) { // Reverse lookup - TInetAddr IpAdd; IpAdd.Input(qt_QString2TPtrC(iHostName)); // Asynchronous request. @@ -279,9 +278,11 @@ void QSymbianHostResolver::requestHostLookup() err = KErrArgument; } else { + iEncodedHostName = QString::fromLatin1(aceHostname); + iHostNamePtr.Set(qt_QString2TPtrC(iEncodedHostName)); // Asynchronous request. - iHostResolver.GetByName(qt_QString2TPtrC(QString::fromLatin1(aceHostname)), iNameResult, iStatus); + iHostResolver.GetByName(iHostNamePtr, iNameResult, iStatus); iState = EGetByName; } } |