From 187184b6c7483c50525fcb3d7e0b3e7371e20b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 27 Sep 2011 12:47:11 +0200 Subject: Prevent potential crash in QXcbConnection::checkEvent(). Change-Id: I4b2ed85fecbfc1cc4fecfa9bb37aa0d9bd329817 Reviewed-on: http://codereview.qt-project.org/5616 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/plugins/platforms/xcb/qxcbconnection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index f7642fa9c9..32919eed20 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -679,7 +679,7 @@ xcb_generic_event_t *QXcbConnection::checkEvent(int type) for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); - if (event->response_type == type) { + if (event && event->response_type == type) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; -- cgit v1.2.3