Fix the sigabrt caused by 8.22-2

This commit is contained in:
Ondřej Vašík 2013-12-22 16:39:13 +01:00
parent f1ce0c9000
commit 94edc2ddc8
2 changed files with 8 additions and 6 deletions

View File

@ -1381,7 +1381,7 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c
static void static void
freeline (struct line *line) freeline (struct line *line)
{ {
@@ -320,56 +479,130 @@ keycmp (struct line const *line1, struct @@ -320,56 +479,131 @@ keycmp (struct line const *line1, struct
size_t jf_1, size_t jf_2) size_t jf_1, size_t jf_2)
{ {
/* Start of field to compare in each file. */ /* Start of field to compare in each file. */
@ -1452,7 +1452,8 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c
+ for (i = 0; i < 2; i++) + for (i = 0; i < 2; i++)
+ { + {
+ mallocd = 1; + mallocd = 1;
+ copy[i] = xcalloc (0, len[i] + 1); + copy[i] = xmalloc (len[i] + 1);
+ memset (copy[i], '\0',len[i] + 1);
+ +
+ for (j = 0; j < MIN (len[0], len[1]);) + for (j = 0; j < MIN (len[0], len[1]);)
+ { + {
@ -3796,7 +3797,7 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c
if (check_chars < oldlen) if (check_chars < oldlen)
oldlen = check_chars; oldlen = check_chars;
if (check_chars < newlen) if (check_chars < newlen)
@@ -284,14 +389,100 @@ different (char *old, char *new, size_t @@ -284,14 +389,101 @@ different (char *old, char *new, size_t
if (ignore_case) if (ignore_case)
{ {
@ -3852,7 +3853,8 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c
+ +
+ for (i = 0; i < 2; i++) + for (i = 0; i < 2; i++)
+ { + {
+ copy[i] = xcalloc (0, len[i] + 1); + copy[i] = xmalloc (len[i] + 1);
+ memset (copy[i], '\0', len[i] + 1);
+ +
+ for (j = 0, chars = 0; j < len[i] && chars < check_chars; chars++) + for (j = 0, chars = 0; j < len[i] && chars < check_chars; chars++)
+ { + {

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils Name: coreutils
Version: 8.22 Version: 8.22
Release: 2%{?dist} Release: 3%{?dist}
License: GPLv3+ License: GPLv3+
Group: System Environment/Base Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/ Url: http://www.gnu.org/software/coreutils/
@ -372,7 +372,7 @@ fi
%{_sbindir}/chroot %{_sbindir}/chroot
%changelog %changelog
* Thu Dec 19 2013 Ondrej Vasik <ovasik@redhat.com> 8.22-2 * Sun Dec 22 2013 Ondrej Vasik <ovasik@redhat.com> 8.22-3
- reset buffer before copying to prevent some rare cases of - reset buffer before copying to prevent some rare cases of
invalid output in join and uniq(#1036289) invalid output in join and uniq(#1036289)