wok-next diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ettercap/stuff/patches/CVE-2017-6430.patch	Tue Sep 01 11:04:25 2020 +0000
     1.3 @@ -0,0 +1,68 @@
     1.4 +From 4ad7f85dc01202e363659aa473c99470b3f4e1f4 Mon Sep 17 00:00:00 2001
     1.5 +From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
     1.6 +Date: Tue, 7 Mar 2017 22:05:31 +0100
     1.7 +Subject: [PATCH] Fix issue #782
     1.8 +
     1.9 +---
    1.10 + utils/etterfilter/ef_compiler.c |  4 +++-
    1.11 + utils/etterfilter/ef_main.c     | 10 +++++++---
    1.12 + utils/etterfilter/ef_output.c   |  3 +++
    1.13 + 3 files changed, 13 insertions(+), 4 deletions(-)
    1.14 +
    1.15 +diff --git a/utils/etterfilter/ef_compiler.c b/utils/etterfilter/ef_compiler.c
    1.16 +index db876636e..ddb73bd30 100644
    1.17 +--- a/utils/etterfilter/ef_compiler.c
    1.18 ++++ b/utils/etterfilter/ef_compiler.c
    1.19 +@@ -239,7 +239,9 @@ size_t compile_tree(struct filter_op **fop)
    1.20 +    struct filter_op *array = NULL;
    1.21 +    struct unfold_elm *ue;
    1.22 + 
    1.23 +-   BUG_IF(tree_root == NULL);
    1.24 ++   // invalid file
    1.25 ++   if (tree_root == NULL)
    1.26 ++      return 0;
    1.27 +   
    1.28 +    fprintf(stdout, " Unfolding the meta-tree ");
    1.29 +    fflush(stdout);
    1.30 +diff --git a/utils/etterfilter/ef_main.c b/utils/etterfilter/ef_main.c
    1.31 +index ae4591344..431084b91 100644
    1.32 +--- a/utils/etterfilter/ef_main.c
    1.33 ++++ b/utils/etterfilter/ef_main.c
    1.34 +@@ -39,7 +39,7 @@ struct globals *gbls;
    1.35 + 
    1.36 + int main(int argc, char *argv[])
    1.37 + {
    1.38 +-
    1.39 ++   int ret_value = 0;
    1.40 +    globals_alloc();
    1.41 +    /* etterfilter copyright */
    1.42 +    fprintf(stdout, "\n" EC_COLOR_BOLD "%s %s" EC_COLOR_END " copyright %s %s\n\n", 
    1.43 +@@ -84,8 +84,12 @@ int main(int argc, char *argv[])
    1.44 +       fprintf(stdout, "\n\nThe script contains errors...\n\n");
    1.45 +   
    1.46 +    /* write to file */
    1.47 +-   if (write_output() != E_SUCCESS)
    1.48 +-      FATAL_ERROR("Cannot write output file (%s)", GBL_OPTIONS->output_file);
    1.49 ++   ret_value = write_output();
    1.50 ++   if (ret_value == -E_NOTHANDLED)
    1.51 ++      FATAL_ERROR("Cannot write output file (%s): the filter is not correctly handled.", GBL_OPTIONS->output_file);
    1.52 ++   else if (ret_value == -E_INVALID)
    1.53 ++      FATAL_ERROR("Cannot write output file (%s): the filter format is not correct. ", GBL_OPTIONS->output_file);
    1.54 ++
    1.55 +    globals_free();
    1.56 +    return 0;
    1.57 + }
    1.58 +diff --git a/utils/etterfilter/ef_output.c b/utils/etterfilter/ef_output.c
    1.59 +index 5ae591904..fcf19f010 100644
    1.60 +--- a/utils/etterfilter/ef_output.c
    1.61 ++++ b/utils/etterfilter/ef_output.c
    1.62 +@@ -51,6 +51,9 @@ int write_output(void)
    1.63 +    if (fop == NULL)
    1.64 +       return -E_NOTHANDLED;
    1.65 + 
    1.66 ++   if (ninst == 0)
    1.67 ++      return -E_INVALID;
    1.68 ++
    1.69 +    /* create the file */
    1.70 +    fd = open(GBL_OPTIONS->output_file, O_CREAT | O_RDWR | O_TRUNC | O_BINARY, 0644);
    1.71 +    ON_ERROR(fd, -1, "Can't create file %s", GBL_OPTIONS->output_file);