Prevent potential crash in QXcbConnection::checkEvent().
authorSamuel Rødal <samuel.rodal@nokia.com>
Tue, 27 Sep 2011 10:47:11 +0000 (12:47 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 28 Sep 2011 01:17:13 +0000 (03:17 +0200)
Change-Id: I4b2ed85fecbfc1cc4fecfa9bb37aa0d9bd329817
Reviewed-on: http://codereview.qt-project.org/5616
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/plugins/platforms/xcb/qxcbconnection.cpp

index f7642fa..32919ee 100644 (file)
@@ -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;