diff options
author | Michael Mann <mmann78@netscape.net> | 2017-12-20 19:23:21 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-12-21 01:16:26 +0000 |
commit | bb5ade02d5f9250c75c74d3920edaeea51561ad0 (patch) | |
tree | ad63fba0ce82a60c8e7873265b99afc817e33dca | |
parent | 530fd0a4d02c55c3dceec800d5c19803f7eddd3b (diff) |
NULL check some g_log statements for extcap.
"Yes, on *most* UN*Xes, that causes "(null)" to be printed, but it causes a crash on at
least some versions of Solaris, so Don't Do It." - Guy Harris
Bug: 14194
Change-Id: Iff0d59803d78b1e87a564e8bcdc5c84af485eea6
Reviewed-on: https://code.wireshark.org/review/24922
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r-- | extcap.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1614,14 +1614,17 @@ static gboolean cb_load_interfaces(extcap_callback_info_t cb_info) { int_iter = (extcap_interface *)walker->data; - g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "Interface found %s\n", int_iter->call); + if (int_iter->call != NULL) + g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "Interface found %s\n", int_iter->call); /* Help is not necessarily stored with the interface, but rather with the version string. * As the version string allways comes in front of the interfaces, this ensures, that it get's * properly stored with the interface */ if (int_iter->if_type == EXTCAP_SENTENCE_EXTCAP) { - g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, " Extcap [%s] ", int_iter->call); + if (int_iter->call != NULL) + g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, " Extcap [%s] ", int_iter->call); + /* Only initialize values if none are set. Need to check only one element here */ if ( ! element->version ) { @@ -1655,8 +1658,8 @@ static gboolean cb_load_interfaces(extcap_callback_info_t cb_info) continue; } - g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, " Interface [%s] \"%s\" ", - int_iter->call, int_iter->display); + if ((int_iter->call != NULL) && (int_iter->display)) + g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, " Interface [%s] \"%s\" ", int_iter->call, int_iter->display); int_iter->extcap_path = g_strdup(cb_info.extcap); |