capture_ifinfo: Don't try to write to an invalid address.
authorGerald Combs <gerald@wireshark.org>
Thu, 26 Apr 2018 23:55:21 +0000 (16:55 -0700)
committerGerald Combs <gerald@wireshark.org>
Fri, 27 Apr 2018 01:23:01 +0000 (01:23 +0000)
Make sure err_str is valid before trying to assign a value.

Change-Id: I4e6524b93101ef28158996797e8462168e44dc2a
Reviewed-on: https://code.wireshark.org/review/27173
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
capchild/capture_ifinfo.c

index d3e893d32f919e54997d61f8dbd8178f814b2666..e67cf35af2dda01d0658dfdad58c880794863240 100644 (file)
@@ -92,7 +92,9 @@ 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;
+    if (err_str) {
+        *err_str = NULL;
+    }
 
     /* Try to get our interface list */
     ret = sync_interface_list_open(&data, &primary_msg, &secondary_msg, update_cb);