diff --git a/wiretap/erf.c b/wiretap/erf.c index 483b9d4b32..ae7875137f 100644 --- a/wiretap/erf.c +++ b/wiretap/erf.c @@ -2607,10 +2607,13 @@ static int populate_capture_host_info(erf_t *erf_priv, wtap *wth, union wtap_pse /* Post processing */ - if (app_name) { - /* If no app_version will just use app_name */ - - tmp = g_strjoin(" ", app_name, app_version, NULL); + if (app_name || app_version) { + /* + * If we have no app_name, we use "(Unknown applicaton)". + * + * If we have no app_version, this will just use app_name. + */ + tmp = g_strjoin(" ", app_name ? app_name : "(Unknown application)", app_version, NULL); wtap_block_set_string_option_value(shb_hdr, OPT_SHB_USERAPPL, tmp, strlen(tmp)); g_free(tmp);