Wireshark-dev: Re: [Wireshark-dev] Patch for crash in uat_gui.c
From: "Luis Ontanon" <luis.ontanon@xxxxxxxxx>
Date: Wed, 14 Feb 2007 20:23:40 +0100
Committed revision 20813.

Thanks!

On 2/14/07, Peter Johansson <Peter.xc.Johansson@xxxxxxxxxxxx> wrote:
Hi!

I have provided a patch for a crash that occurs in uat_gui.c if from the
"Edit preferences..." button when you choose Protocols -> DLT_USER ->
the "Edit..." button -> the "New" button -> the "Cancel" button.
The crash happens because dd gets freed prior to traversing its internal
structure, hence I moved the call to g_free for dd beneath the traversal
of the dd internals.

Regards, Peter

Index: C:/wireshark-win32-libs/gtk/uat_gui.c
===================================================================
--- C:/wireshark-win32-libs/gtk/uat_gui.c       (revision 20793)
+++ C:/wireshark-win32-libs/gtk/uat_gui.c       (working copy)
@@ -371,10 +371,11 @@
        if (dd->is_new) g_free(dd->rec);
     g_ptr_array_free(dd->entries,TRUE);
     window_destroy(GTK_WIDGET(dd->win));
-       g_free(dd);

        while (dd->tobe_freed->len) g_free( g_ptr_array_remove_index_fast(dd->tobe_freed, dd->tobe_freed->len - 1 ) );

+       g_free(dd);
+
     return TRUE;
 }


_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev




--
This information is top security. When you have read it, destroy yourself.
-- Marshall McLuhan