diff options
Diffstat (limited to 'tools/patch')
-rw-r--r-- | tools/patch/patches/010-CVE-2018-1000156.patch | 70 | ||||
-rw-r--r-- | tools/patch/patches/020-CVE-2018-6952.patch | 5 |
2 files changed, 3 insertions, 72 deletions
diff --git a/tools/patch/patches/010-CVE-2018-1000156.patch b/tools/patch/patches/010-CVE-2018-1000156.patch index c83e240fb6..7114f82e8f 100644 --- a/tools/patch/patches/010-CVE-2018-1000156.patch +++ b/tools/patch/patches/010-CVE-2018-1000156.patch @@ -16,8 +16,6 @@ instead of rejecting them and carrying on. 3 files changed, 108 insertions(+), 23 deletions(-) create mode 100644 tests/ed-style -diff --git a/src/pch.c b/src/pch.c -index ff9ed2c..8150493 100644 --- a/src/pch.c +++ b/src/pch.c @@ -33,6 +33,7 @@ @@ -28,7 +26,7 @@ index ff9ed2c..8150493 100644 #define INITHUNKMAX 125 /* initial dynamic allocation size */ -@@ -2388,22 +2389,28 @@ do_ed_script (char const *inname, char const *outname, +@@ -2388,22 +2389,28 @@ do_ed_script (char const *inname, char c static char const editor_program[] = EDITOR_PROGRAM; file_offset beginning_of_this_line; @@ -71,7 +69,7 @@ index ff9ed2c..8150493 100644 for (;;) { char ed_command_letter; beginning_of_this_line = file_tell (pfp); -@@ -2414,14 +2421,14 @@ do_ed_script (char const *inname, char const *outname, +@@ -2414,14 +2421,14 @@ do_ed_script (char const *inname, char c } ed_command_letter = get_ed_command_letter (buf); if (ed_command_letter) { @@ -90,7 +88,7 @@ index ff9ed2c..8150493 100644 write_fatal (); if (chars_read == 2 && strEQ (buf, ".\n")) break; -@@ -2434,13 +2441,49 @@ do_ed_script (char const *inname, char const *outname, +@@ -2434,13 +2441,49 @@ do_ed_script (char const *inname, char c break; } } @@ -145,65 +143,3 @@ index ff9ed2c..8150493 100644 if (ofp) { -diff --git a/tests/Makefile.am b/tests/Makefile.am -index 6b6df63..16f8693 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -32,6 +32,7 @@ TESTS = \ - crlf-handling \ - dash-o-append \ - deep-directories \ -+ ed-style \ - empty-files \ - false-match \ - fifo \ -diff --git a/tests/ed-style b/tests/ed-style -new file mode 100644 -index 0000000..d8c0689 ---- /dev/null -+++ b/tests/ed-style -@@ -0,0 +1,41 @@ -+# Copyright (C) 2018 Free Software Foundation, Inc. -+# -+# Copying and distribution of this file, with or without modification, -+# in any medium, are permitted without royalty provided the copyright -+# notice and this notice are preserved. -+ -+. $srcdir/test-lib.sh -+ -+require cat -+use_local_patch -+use_tmpdir -+ -+# ============================================================== -+ -+cat > ed1.diff <<EOF -+0a -+foo -+. -+EOF -+ -+check 'patch -e foo -i ed1.diff' <<EOF -+EOF -+ -+check 'cat foo' <<EOF -+foo -+EOF -+ -+cat > ed2.diff <<EOF -+1337a -+r !echo bar -+,p -+EOF -+ -+check 'patch -e foo -i ed2.diff 2> /dev/null || echo "Status: $?"' <<EOF -+? -+Status: 2 -+EOF -+ -+check 'cat foo' <<EOF -+foo -+EOF --- -2.19.1 - diff --git a/tools/patch/patches/020-CVE-2018-6952.patch b/tools/patch/patches/020-CVE-2018-6952.patch index e3e4020e50..e72a8cbc27 100644 --- a/tools/patch/patches/020-CVE-2018-6952.patch +++ b/tools/patch/patches/020-CVE-2018-6952.patch @@ -12,8 +12,6 @@ Fixes: https://savannah.gnu.org/bugs/index.php?53133 src/pch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/src/pch.c b/src/pch.c -index 8150493..6994ab2 100644 --- a/src/pch.c +++ b/src/pch.c @@ -2114,7 +2114,7 @@ pch_swap (void) @@ -25,6 +23,3 @@ index 8150493..6994ab2 100644 else n = -i; p_efake += n; --- -2.19.1 - |