From c8e56fa2cfc8ce8553495b3c33a7890fd82862f8 Mon Sep 17 00:00:00 2001 From: Mariano Reingart Date: Mon, 19 Jan 2015 03:02:23 +0000 Subject: [PATCH] Fix crash from possible NULL pointer in wxQT list ctrl Thanks @seandepagnier git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/qt/listctrl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qt/listctrl.cpp b/src/qt/listctrl.cpp index 9c3ccbc2eb..4b52c54f76 100644 --- a/src/qt/listctrl.cpp +++ b/src/qt/listctrl.cpp @@ -783,12 +783,14 @@ long wxListCtrl::HitTest(const wxPoint& point, int &flags, long* ptrSubItem) con if ( index.isValid() ) { flags = wxLIST_HITTEST_ONITEM; - *ptrSubItem = index.column(); + if (ptrSubItem) + *ptrSubItem = index.column(); } else { flags = wxLIST_HITTEST_NOWHERE; - *ptrSubItem = 0; + if (ptrSubItem) + *ptrSubItem = 0; } return index.row(); }