From ec5acbc33cfc8e6c82706574814d7232b26112c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Fri, 11 Mar 2016 18:42:49 +0100 Subject: wtap: Make default_filter static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address of stack memory associated with local variable 'default_filter' is still referred to by the global variable 'filter_option' upon returning to the caller. This will be a dangling reference. Change-Id: I6160a37f05b8aea245b723ec50803e4062886738 Reviewed-on: https://code.wireshark.org/review/14427 Petri-Dish: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- wiretap/wtap_opttypes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'wiretap/wtap_opttypes.c') diff --git a/wiretap/wtap_opttypes.c b/wiretap/wtap_opttypes.c index 296a6fb29d..f42aa26250 100644 --- a/wiretap/wtap_opttypes.c +++ b/wiretap/wtap_opttypes.c @@ -610,8 +610,7 @@ static void idb_create(wtap_optionblock_t block) static wtap_optblock_reg_t os_option = {"os", "Operating System", WTAP_OPTTYPE_STRING, {0}, {0}}; static wtap_optblock_reg_t fcslen_option = {"fcslen", "FCS Length", WTAP_OPTTYPE_UINT8, {0}, {0}}; - wtapng_if_descr_filter_t default_filter; - memset(&default_filter, 0, sizeof(default_filter)); + static wtapng_if_descr_filter_t default_filter; block->mandatory_data = g_new0(wtapng_if_descr_mandatory_t, 1); -- cgit v1.2.1