From 064a2316b088a0ebdd4100e94cc16a5446eb2769 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Mon, 30 Jan 2012 14:35:12 +0000 Subject: 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 --- src/network/socket/qabstractsocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 6264ee4c21..b6d0733f6d 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 -- cgit v1.2.3