diff --git a/gawk-3.1.5-fieldwidths.patch b/gawk-3.1.5-fieldwidths.patch new file mode 100644 index 0000000..398617f --- /dev/null +++ b/gawk-3.1.5-fieldwidths.patch @@ -0,0 +1,29 @@ +--- gawk-3.1.5/field.c.fieldwidths 2005-05-11 17:28:15.000000000 +0200 ++++ gawk-3.1.5/field.c 2005-10-09 08:35:54.000000000 +0200 +@@ -916,7 +916,7 @@ + + parse_field = fw_parse_field; + scan = force_string(FIELDWIDTHS_node->var_value)->stptr; +- end = scan + 1; ++ + if (FIELDWIDTHS == NULL) + emalloc(FIELDWIDTHS, int *, fw_alloc * sizeof(int), "set_FIELDWIDTHS"); + FIELDWIDTHS[0] = 0; +@@ -941,7 +941,7 @@ + errno = 0; + tmp = strtoul(scan, &end, 10); + if (errno != 0 +- || !(*end == '\0' || is_blank(*end)) ++ || (*end != '\0' && ! is_blank(*end)) + || !(0 < tmp && tmp <= INT_MAX)) + fatal(_("invalid FIELDWIDTHS value, near `%s'"), + scan); +@@ -954,7 +954,7 @@ + if (*scan == '\0') + break; + } +- FIELDWIDTHS[i] = -1; ++ FIELDWIDTHS[i+1] = -1; + + update_PROCINFO("FS", "FIELDWIDTHS"); + } diff --git a/gawk.spec b/gawk.spec index 2f770eb..16f4af6 100644 --- a/gawk.spec +++ b/gawk.spec @@ -1,17 +1,19 @@ Summary: The GNU version of the awk text processing utility. Name: gawk Version: 3.1.5 -Release: 3 +Release: 4 License: GPL Group: Applications/Text Source0: ftp://ftp.gnu.org/gnu/gawk/gawk-%{version}.tar.bz2 Source1: ftp://ftp.gnu.org/gnu/gawk/gawk-%{version}-ps.tar.gz -Patch1: gawk-3.1.3-getpgrp_void.patch -Patch2: gawk-3.1.5-free.patch Prereq: /sbin/install-info Requires: /bin/mktemp Buildroot: %{_tmppath}/%{name}-root +Patch1: gawk-3.1.3-getpgrp_void.patch +Patch2: gawk-3.1.5-free.patch +Patch3: gawk-3.1.5-fieldwidths.patch + %description The gawk packages contains the GNU version of awk, a text processing utility. Awk interprets a special-purpose programming language to do @@ -24,6 +26,7 @@ considered to be a standard Linux tool for processing text. %setup -q -b 1 %patch1 -p1 -b .getpgrp_void %patch2 -p1 -b .free +%patch3 -p1 -b .fieldwidths %build %configure @@ -72,6 +75,10 @@ fi %{_datadir}/awk %changelog +* Sun Oct 9 2005 Karel Zak 3.1.5-4 +- fix off-by-one error in assignment of sentinel value at + end of FIELDWIDTHS array. (patch by - upstream - Aharon Robbins) + * Tue Sep 27 2005 Karel Zak 3.1.5-3 - fix #169374 - Invalid Free (patch by Aharon Robbins)