[Geany-devel] [Patch] Avoid crash when opening project properties dialog

Lex Trotman elextr at xxxxx
Wed Mar 10 00:58:13 UTC 2010


On 9 March 2010 18:43, Wolfgang Ocker <weo at reccoware.de> wrote:

> I observed a crash in build_commands_table() when trying to open the
> project properties window:
>
>
> #0  build_commands_table (doc=<value optimized out>,
>    dst=<value optimized out>, table_data=<value optimized out>, ft=0x0)
>    at build.c:1862
> #1  0x000000000047bc0d in create_properties_dialog () at project.c:481
> #2  project_properties () at project.c:539
> #3  0x00000039da80ba8e in g_closure_invoke ()
> from /lib64/libgobject-2.0.so.0
> #4  0x00000039da820ec3 in ?? () from /lib64/libgobject-2.0.so.0
> #5  0x00000039da822259 in g_signal_emit_valist ()
>   from /lib64/libgobject-2.0.so.0
> #6  0x00000039da8227a3 in g_signal_emit ()
> from /lib64/libgobject-2.0.so.0
> #7  0x0000003653c7d3be in gtk_widget_activate ()
>   from /usr/lib64/libgtk-x11-2.0.so.0
> ...
>
> ft is NULL there, which looks like a valid value, since ft is tested for
> NULL explicitly in line 1878. So I propose the following patch.
>
> Best regards,
> Wolfgang
>
> Index: src/build.c
> ===================================================================
> --- src/build.c (revision 4745)
> +++ src/build.c (working copy)
> @@ -1859,7 +1859,7 @@
>        sep = gtk_hseparator_new();
>        gtk_table_attach(table, sep, 0, DC_N_COL, 1, 2, GTK_FILL, GTK_FILL |
> GTK_EXPAND,
>                entry_x_padding, sep_padding);
> -       if (ft->id != GEANY_FILETYPES_NONE)
> +       if (ft != NULL && ft->id != GEANY_FILETYPES_NONE)
>                txt = g_strdup_printf(_("%s Commands"), ft->title);
>        else
>                txt = g_strdup_printf(_("%s Commands"), _("No Filetype"));
>
>
Thanks

Fixed in SVN, can you check it since it didn't crash for me before the fix.

Cheers
Lex

PS Thanks for the traceback, helped find the uninitialised variable, if only
everyone provided such useful info :-)



>
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20100310/ffb3cde6/attachment.html>


More information about the Devel mailing list