diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2014-03-21 10:35:20 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-03-21 21:24:28 +0000 |
commit | 97ba9406e73646c1653189a5980559abc8b207fa (patch) | |
tree | f3409142dab6c07ad13aea2816d3205ca62844fe /ui/gtk/capture_dlg.c | |
parent | 752e545fbf098985512f3188ba73b31b1052ac41 (diff) |
fix a crash in the GTK "Interface Management" dialogue
for Pipes and Local Interfaces
(Capture / Options / Manage Interfaces)
if you start with an empty dialogue, select a pipe using Browse and
press Save, wireshark crashes because of a strcmp() against the
uninitialized pipe_name
initialize pipe_name to NULL and make sure its value is reset when the
dialogue is closed
don't add a pipe unless there's an active selection in the pipe list
(which may be "New Pipe")
Change-Id: Id460c8d0d43cd7fc4cb8f4e9b4357898bbef20f7
Reviewed-on: https://code.wireshark.org/review/776
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/gtk/capture_dlg.c')
-rw-r--r-- | ui/gtk/capture_dlg.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c index 5ff27873a2..1de3d81822 100644 --- a/ui/gtk/capture_dlg.c +++ b/ui/gtk/capture_dlg.c @@ -225,7 +225,7 @@ static GtkWidget *cap_open_w = NULL, *opt_edit_w = NULL, *ok_bt, *interface_mana static GtkWidget *compile_bpf_w = NULL; #endif static gboolean cap_open_complete; /* valid only if cap_open_w != NULL */ -static const gchar *pipe_name; +static const gchar *pipe_name = NULL; static const gchar *selected_name; static GtkWidget *columns_menu_object; static GtkUIManager *ui_manager_columns = NULL; @@ -3436,6 +3436,9 @@ add_pipe_cb(gpointer w _U_) guint i; gpointer dialog; + if (!pipe_name) + return; + pipe_te = (GtkWidget *) g_object_get_data(G_OBJECT(interface_management_w), E_CAP_PIPE_TE_KEY); g_save_file = gtk_entry_get_text(GTK_ENTRY(pipe_te)); name = g_strdup(g_save_file); @@ -3675,6 +3678,7 @@ static void cancel_pipe_cb (gpointer w _U_) { window_destroy(GTK_WIDGET(interface_management_w)); + pipe_name = NULL; } static void |