From: Shane Kearns Date: Mon, 30 Jan 2012 14:35:12 +0000 (+0000) Subject: Fix crashing debug message X-Git-Tag: qt-v5.0.0-alpha1~1472 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=064a2316b088a0ebdd4100e94cc16a5446eb2769;p=profile%2Fivi%2Fqtbase.git Fix crashing debug message The debug message could derefence a null pointer, this crashed when running ssl autotests Change-Id: I176aaa9f3cf3c6cc1512cdc34db06d4c79f92e73 Reviewed-by: Richard J. Moore --- diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 6264ee4..b6d0733 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -811,7 +811,7 @@ bool QAbstractSocketPrivate::flush() && socketEngine->bytesToWrite() == 0)) { #if defined (QABSTRACTSOCKET_DEBUG) qDebug("QAbstractSocketPrivate::flush() nothing to do: valid ? %s, writeBuffer.isEmpty() ? %s", - socketEngine->isValid() ? "yes" : "no", writeBuffer.isEmpty() ? "yes" : "no"); + (socketEngine && socketEngine->isValid()) ? "yes" : "no", writeBuffer.isEmpty() ? "yes" : "no"); #endif // this covers the case when the buffer was empty, but we had to wait for the socket engine to finish