initialize required interface_t components of a newly created interface

this should fix crashes in the interface list handling when the
interface list contains pipes initliazed by scan_local_interfaces() or
add_pipe_cb()

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7511

svn path=/trunk/; revision=43922
This commit is contained in:
Martin Kaiser 2012-07-22 22:09:46 +00:00
parent 10c9e21812
commit 048fcbdf2f
2 changed files with 6 additions and 1 deletions

View File

@ -2706,7 +2706,8 @@ add_pipe_cb(gpointer w _U_)
device.buffer = 1;
#endif
device.active_dlt = -1;
device.if_info.name = NULL;
device.locked = FALSE;
device.if_info.name = g_strdup(g_save_file);
device.if_info.description = NULL;
device.if_info.addrs = NULL;
device.if_info.loopback = FALSE;

View File

@ -306,6 +306,10 @@ scan_local_interfaces(capture_options* capture_opts)
device.links = NULL;
device.local = TRUE;
device.locked = FALSE;
device.if_info.name = g_strdup(interface_opts.name);
device.if_info.description = g_strdup(interface_opts.descr);
device.if_info.addrs = NULL;
device.if_info.loopback = FALSE;
g_array_append_val(capture_opts->all_ifaces, device);
capture_opts->num_selected++;