segfault in wm_win_force_dialog()
Ian Campbell <[email protected]> Mon, 31 Jan 2005 16:30:21 +0000
| Newsgroups | gmane.comp.handhelds.matchbox |
|---|---|
| Organization | Arcom Control Systems |
| Message-ID | <1107189021.14895.64.camel@icampbell-debian> |
Hi,
I was seeing a segmentation fault in wm_win_force_dialog() because
w->config->force_dialogs was not initialised and pointed off into the
weeds.
I happened to have build with XRM support, but I think the same issue
exists in the NO_XRM variant as well.
The attached patch fixes the problem by initialising the variable in
both places. It's against 0.9.2 but it doesn't look like SVN has changed
much in this area.
Perhaps a memset to 0 might be better though?
(please cc me on replies I didn't subscribe)
Ian.
--- matchbox-window-manager-0.9.2.orig/src/wm.c
+++ matchbox-window-manager-0.9.2/src/wm.c
@@ -295,6 +295,7 @@
w->config->dialog_shade = False;
w->config->dialog_stratergy = WM_DIALOGS_STRATERGY_CONSTRAINED;
w->config->ping_handler = NULL;
+ w->config->force_dialogs = NULL;
#ifdef USE_COMPOSITE
w->config->dialog_shade = True;
@@ -454,6 +455,7 @@
w->config->dialog_shade = False;
w->config->dialog_stratergy = WM_DIALOGS_STRATERGY_CONSTRAINED;
w->config->ping_handler = NULL;
+ w->config->force_dialogs = NULL;
if (XrmGetResource(rDB, "matchbox.display",
"Matchbox.Display",
--
Ian Campbell, Senior Design Engineer
Web: http://www.arcom.com
Arcom, Clifton Road, Direct: +44 (0)1223 403 465
Cambridge CB1 7EA, United Kingdom Phone: +44 (0)1223 411 200