Fix potential null pointer dereference

pull/1/head
Slávek Banko 11 years ago
parent 5da15f81a7
commit bb6df872fe

@ -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

Loading…
Cancel
Save