aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorTomasz Moń <desowin@gmail.com>2019-08-13 18:41:23 +0200
committerPeter Wu <peter@lekensteyn.nl>2019-08-14 20:33:21 +0000
commitc4b68b4935081f291795d60a91518a98b6ba9d0d (patch)
treea7a995246598973fbdfa9cecca2366d463282956 /file.c
parent81d2de9252e87de83963f3f3bbfe101c65582a90 (diff)
Wiretap: Fix temporary filename memory corruption
The pointer returned by create_tempfile() must not be freed. As the wtap_dump_open_tempfile() callers are freeing the returned filename, duplicate the string so it can be freed. Bug: 15377 Change-Id: Ib0b23aaee748ef67600ef3f7d40610ebbbec721c Reviewed-on: https://code.wireshark.org/review/34272 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/file.c b/file.c
index d91a48fe35..9427565f13 100644
--- a/file.c
+++ b/file.c
@@ -1373,7 +1373,7 @@ merge_callback(merge_event event, int num _U_,
cf_status_t
cf_merge_files_to_tempfile(gpointer pd_window, char **out_filenamep,
- int in_file_count, char *const *in_filenames,
+ int in_file_count, const char *const *in_filenames,
int file_type, gboolean do_append)
{
int err = 0;
@@ -1393,7 +1393,7 @@ cf_merge_files_to_tempfile(gpointer pd_window, char **out_filenamep,
/* merge the files */
status = merge_files_to_tempfile(out_filenamep, "wireshark", file_type,
- (const char *const *) in_filenames,
+ in_filenames,
in_file_count, do_append,
IDB_MERGE_MODE_ALL_SAME, 0 /* snaplen */,
"Wireshark", &cb, &err, &err_info,