diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-05 09:15:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-05 09:15:59 +0000 |
commit | 489b73a4c69e01167e693d7153f973105c613c30 (patch) | |
tree | 5d72d5ab3cf7dd8efa4e1733579d216d79c8ad66 /wiretap/merge.c | |
parent | Releasing progress-linux version 4.2.5-2~progress7.99u1. (diff) | |
download | wireshark-489b73a4c69e01167e693d7153f973105c613c30.tar.xz wireshark-489b73a4c69e01167e693d7153f973105c613c30.zip |
Merging upstream version 4.2.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wiretap/merge.c')
-rw-r--r-- | wiretap/merge.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/wiretap/merge.c b/wiretap/merge.c index 82154f9b..3c007dd6 100644 --- a/wiretap/merge.c +++ b/wiretap/merge.c @@ -1420,6 +1420,22 @@ merge_files(const gchar* out_filename, const int file_type, guint32 *err_framenum) { ws_assert(out_filename != NULL); + ws_assert(in_file_count > 0); + ws_assert(in_filenames != NULL); + ws_assert(err_info != NULL); + + /* #19402: ensure we aren't appending to one of our inputs */ + if (do_append) { + unsigned int i; + for (i = 0; i < in_file_count; i++) { + if (files_identical(out_filename, in_filenames[i])) { + *err_info = ws_strdup_printf("Output file %s is same as input file %s; " + "appending would create infinite loop", + out_filename, in_filenames[i]); + return MERGE_ERR_INVALID_OPTION; + } + } + } return merge_files_common(out_filename, NULL, NULL, file_type, in_filenames, in_file_count, |