Re: segfault in wm_win_force_dialog()

[email protected] (Matthew Allum) Mon, 31 Jan 2005 10:34:44 -0600
Newsgroups gmane.comp.handhelds.matchbox
Message-ID <[email protected]>
Thanks for the heads up. I've just commited a rather sensible memset
addition.

Thanks again;

  -- Matthew

on Mon, Jan 31, 2005 at 04:30:21PM +0000, Ian Campbell wrote:
> 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
> 
> _______________________________________________
> Matchbox mailing list
> [email protected]
> https://handhelds.org/mailman/listinfo/matchbox

-- 
--------------------------------------------------
///` OpenedHand Ltd.

51 Great Brownings / London / SE21 7HP / UK
Tel: +44 (0)208 676 4077

`X not on the desktop' - http://o-hand.com
--------------------------------------------------