diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2016-07-26 13:58:55 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2016-07-26 13:48:40 +0000 |
commit | 4713ce4476cadb2d4a8869dd2e6f19547841aa9a (patch) | |
tree | 49eb6200d40c11472aa3283236b3ad38ba0c2b45 /wiretap/nettrace_3gpp_32_423.c | |
parent | 3a3bf8926eaa57bbe3941cbb0fb5d30ad92ede11 (diff) |
Ensure to have a valid string pointer when writing OS SHB option
Change-Id: Ib0b6dcdf1700e88383d30bf43739312fce10e1c7
Reviewed-on: https://code.wireshark.org/review/16696
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'wiretap/nettrace_3gpp_32_423.c')
-rw-r--r-- | wiretap/nettrace_3gpp_32_423.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/wiretap/nettrace_3gpp_32_423.c b/wiretap/nettrace_3gpp_32_423.c index fa3d513603..5495476af7 100644 --- a/wiretap/nettrace_3gpp_32_423.c +++ b/wiretap/nettrace_3gpp_32_423.c @@ -729,6 +729,7 @@ create_temp_pcapng_file(wtap *wth, int *err, gchar **err_info, nettrace_3gpp_32_ int name_str_len; char name_str[64]; gsize opt_len; + gchar *opt_str; /* Info to build exported_pdu tags*/ exported_pdu_info_t exported_pdu_info; @@ -762,7 +763,11 @@ create_temp_pcapng_file(wtap *wth, int *err, gchar **err_info, nettrace_3gpp_32_ * this section. */ opt_len = os_info_str->len; - wtap_block_add_string_option(shb_hdr, OPT_SHB_OS, g_string_free(os_info_str, TRUE), opt_len); + opt_str = g_string_free(os_info_str, FALSE); + if (opt_str) { + wtap_block_add_string_option(shb_hdr, OPT_SHB_OS, opt_str, opt_len); + g_free(opt_str); + } /* * UTF-8 string containing the name of the application used to create |