summaryrefslogtreecommitdiffstats
path: root/src/tools/qstring.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2014-05-23 03:07:19 +0200
committerSlávek Banko <slavek.banko@axis.cz>2014-05-23 03:07:19 +0200
commit456dc48a97b1cd3ce8eb94eb6c61fa1948d3d6fa (patch)
tree4a5c8e7915ac79d8aac2c8e68a1b5f4d735cff4c /src/tools/qstring.cpp
parent3d29992e94dc1238567be60c761b3be6b36437a7 (diff)
downloadqt3-456dc48a97b1cd3ce8eb94eb6c61fa1948d3d6fa.tar.gz
qt3-456dc48a97b1cd3ce8eb94eb6c61fa1948d3d6fa.zip
Fix potential null pointer dereference
Diffstat (limited to 'src/tools/qstring.cpp')
-rw-r--r--src/tools/qstring.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/qstring.cpp b/src/tools/qstring.cpp
index 7f246fa..210848c 100644
--- a/src/tools/qstring.cpp
+++ b/src/tools/qstring.cpp
@@ -1513,7 +1513,7 @@ QString::QString( QChar ch )
QString::QString( const QString &s ) :
d(s.d)
{
- if (d != shared_null) {
+ if ( d && (d != shared_null) ) {
#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
@@ -1765,7 +1765,7 @@ void QStringData::deleteSelf()
*/
QString &QString::operator=( const QString &s )
{
- if (s.d != shared_null) {
+ if ( s.d && (s.d != shared_null) ) {
#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
s.d->mutex->lock();
#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE