wok-next view ettercap/stuff/patches/CVE-2017-6430.patch @ rev 21724

busybox: update configs
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Sep 01 11:04:25 2020 +0000 (2020-09-01)
parents
children
line source
1 From 4ad7f85dc01202e363659aa473c99470b3f4e1f4 Mon Sep 17 00:00:00 2001
2 From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
3 Date: Tue, 7 Mar 2017 22:05:31 +0100
4 Subject: [PATCH] Fix issue #782
6 ---
7 utils/etterfilter/ef_compiler.c | 4 +++-
8 utils/etterfilter/ef_main.c | 10 +++++++---
9 utils/etterfilter/ef_output.c | 3 +++
10 3 files changed, 13 insertions(+), 4 deletions(-)
12 diff --git a/utils/etterfilter/ef_compiler.c b/utils/etterfilter/ef_compiler.c
13 index db876636e..ddb73bd30 100644
14 --- a/utils/etterfilter/ef_compiler.c
15 +++ b/utils/etterfilter/ef_compiler.c
16 @@ -239,7 +239,9 @@ size_t compile_tree(struct filter_op **fop)
17 struct filter_op *array = NULL;
18 struct unfold_elm *ue;
20 - BUG_IF(tree_root == NULL);
21 + // invalid file
22 + if (tree_root == NULL)
23 + return 0;
25 fprintf(stdout, " Unfolding the meta-tree ");
26 fflush(stdout);
27 diff --git a/utils/etterfilter/ef_main.c b/utils/etterfilter/ef_main.c
28 index ae4591344..431084b91 100644
29 --- a/utils/etterfilter/ef_main.c
30 +++ b/utils/etterfilter/ef_main.c
31 @@ -39,7 +39,7 @@ struct globals *gbls;
33 int main(int argc, char *argv[])
34 {
35 -
36 + int ret_value = 0;
37 globals_alloc();
38 /* etterfilter copyright */
39 fprintf(stdout, "\n" EC_COLOR_BOLD "%s %s" EC_COLOR_END " copyright %s %s\n\n",
40 @@ -84,8 +84,12 @@ int main(int argc, char *argv[])
41 fprintf(stdout, "\n\nThe script contains errors...\n\n");
43 /* write to file */
44 - if (write_output() != E_SUCCESS)
45 - FATAL_ERROR("Cannot write output file (%s)", GBL_OPTIONS->output_file);
46 + ret_value = write_output();
47 + if (ret_value == -E_NOTHANDLED)
48 + FATAL_ERROR("Cannot write output file (%s): the filter is not correctly handled.", GBL_OPTIONS->output_file);
49 + else if (ret_value == -E_INVALID)
50 + FATAL_ERROR("Cannot write output file (%s): the filter format is not correct. ", GBL_OPTIONS->output_file);
51 +
52 globals_free();
53 return 0;
54 }
55 diff --git a/utils/etterfilter/ef_output.c b/utils/etterfilter/ef_output.c
56 index 5ae591904..fcf19f010 100644
57 --- a/utils/etterfilter/ef_output.c
58 +++ b/utils/etterfilter/ef_output.c
59 @@ -51,6 +51,9 @@ int write_output(void)
60 if (fop == NULL)
61 return -E_NOTHANDLED;
63 + if (ninst == 0)
64 + return -E_INVALID;
65 +
66 /* create the file */
67 fd = open(GBL_OPTIONS->output_file, O_CREAT | O_RDWR | O_TRUNC | O_BINARY, 0644);
68 ON_ERROR(fd, -1, "Can't create file %s", GBL_OPTIONS->output_file);