Fix crash (double-free) on refreshing interfaces list
authorPeter Wu <peter@lekensteyn.nl>
Thu, 26 Apr 2018 11:38:07 +0000 (13:38 +0200)
committerPeter Wu <peter@lekensteyn.nl>
Thu, 26 Apr 2018 16:15:45 +0000 (16:15 +0000)
When normal interfaces are unavailable (chmod -x dumpcap), and after
toggling "Disable external capture interfaces" twice and then refreshing
the interfaces list (F5), a double-free occurs in ui/iface_lists.c:147
for "global_capture_opts.ifaces_err_info".

Change-Id: I98697653ab1c123186892408112c34afdd1766f5
Fixes: v1.99.0-rc1-1005-g35b4487538 ("Handle empty interface lists when the list changes.")
Reviewed-on: https://code.wireshark.org/review/27161
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
capchild/capture_ifinfo.c

index 0236d468beeb4c8ad3f6021cc09f21175929b36d..d3e893d32f919e54997d61f8dbd8178f814b2666 100644 (file)
@@ -92,6 +92,7 @@ capture_interface_list(int *err, char **err_str, void (*update_cb)(void))
     g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Interface List ...");
 
     *err = 0;
+    *err_str = NULL;
 
     /* Try to get our interface list */
     ret = sync_interface_list_open(&data, &primary_msg, &secondary_msg, update_cb);