#15173 closed defect (fixed)

Crash in wxPopupWindow::Create() for parent-less popups

Reported by: Mithrandir Owned by:
Priority: normal Milestone: 3.0.0
Component: wxGTK Version: 2.9.4
Keywords: crash wxPopupWindow Create regression Cc:
Blocked By: Blocking:
Patch: yes

Description

The wxPopupWindow::Create method from the gtk\popupwin.cpp file accesses pointer to a parent window without checking in the line 112:
GtkWidget *toplevel = gtk_widget_get_toplevel( parent->m_widget );

Situation when a window is created without parent is normal. This method works correctly in the wxWidgets 2.8.12. So, this bug is the regression against the latest stable version.

Attachments (1)

mypatch.patch download (1.6 KB) - added by Mithrandir 15 months ago.
This is the patch for the issue described here

Download all attachments as: .zip

Change History (5)

comment:1 Changed 15 months ago by vadz

  • Keywords crash regression added; segmentation fault parent pointer removed
  • Milestone changed from 2.9.5 to 3.0
  • Priority changed from high to normal
  • Status changed from new to confirmed
  • Summary changed from Segmentation fault in the wxPopupWindow::Create method to Crash in wxPopupWindow::Create() for parent-less popups

Would you have any test code for this?

Alternatively, if fixing this is as simple as adding checks for parent != NULL, could you please try to do it and submit a patch with your changes if they work for you?

TIA!

Changed 15 months ago by Mithrandir

This is the patch for the issue described here

comment:2 Changed 15 months ago by Mithrandir

I have attached the path against the WX_2_9_0_BRANCH. It will be appreciated if you included this fix into the 2.9.5 version.

comment:3 Changed 14 months ago by Mithrandir

  • Patch set

comment:4 Changed 14 months ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [73987]) Fix crash in wxGTK wxPopupWindow when creating it without parent.

Popup windows don't necessarily have a parent, so don't crash if parent
pointer is NULL in wxPopupWindow::Create().

Closes #15173.

Note: See TracTickets for help on using tickets.