summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2014-05-23 03:07:23 +0200
committerSlávek Banko <[email protected]>2014-05-23 03:07:23 +0200
commitbb6df872fea9a8980016b9e54eea2fbde00062c0 (patch)
treec409d1e144afa85fca7de088503d0527dc3796ef
parent5da15f81a77c0209fabc86fe6b2866ef8c127e76 (diff)
downloadtqt3-bb6df872fea9a8980016b9e54eea2fbde00062c0.tar.gz
tqt3-bb6df872fea9a8980016b9e54eea2fbde00062c0.zip
Fix potential null pointer dereference
-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 808a0bea5..927669c61 100644
--- a/src/tools/qstring.cpp
+++ b/src/tools/qstring.cpp
@@ -1513,7 +1513,7 @@ TQString::TQString( TQChar ch )
TQString::TQString( const TQString &s ) :
d(s.d)
{
- if (d != shared_null) {
+ if ( d && (d != shared_null) ) {
#if defined(QT_THREAD_SUPPORT) && defined(MAKE_TQSTRING_THREAD_SAFE)
d->mutex->lock();
#endif // QT_THREAD_SUPPORT && MAKE_TQSTRING_THREAD_SAFE
@@ -1765,7 +1765,7 @@ void TQStringData::deleteSelf()
*/
TQString &TQString::operator=( const TQString &s )
{
- if (s.d != shared_null) {
+ if ( s.d && (s.d != shared_null) ) {
#if defined(QT_THREAD_SUPPORT) && defined(MAKE_TQSTRING_THREAD_SAFE)
s.d->mutex->lock();
#endif // QT_THREAD_SUPPORT && MAKE_TQSTRING_THREAD_SAFE