diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch index 2efe93e..a3c7b33 100644 --- a/coreutils-i18n.patch +++ b/coreutils-i18n.patch @@ -473,7 +473,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c } /* Process file FILE to standard output. -@@ -687,6 +1038,7 @@ main (int argc, char **argv) +@@ -687,6 +1042,7 @@ main (int argc, char **argv) bool ok; bool delim_specified = false; char *spec_list_string IF_LINT ( = NULL); @@ -481,7 +481,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c initialize_main (&argc, &argv); set_program_name (argv[0]); -@@ -709,7 +1061,6 @@ main (int argc, char **argv) +@@ -709,7 +1065,6 @@ main (int argc, char **argv) switch (optc) { case 'b': @@ -489,7 +489,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c /* Build the byte list. */ if (operating_mode != undefined_mode) FATAL_ERROR (_("only one type of list may be specified")); -@@ -717,6 +1068,14 @@ main (int argc, char **argv) +@@ -717,6 +1072,14 @@ main (int argc, char **argv) spec_list_string = optarg; break; @@ -504,7 +504,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c case 'f': /* Build the field list. */ if (operating_mode != undefined_mode) -@@ -728,10 +1087,38 @@ main (int argc, char **argv) +@@ -728,10 +1091,38 @@ main (int argc, char **argv) case 'd': /* New delimiter. */ /* Interpret -d '' to mean 'use the NUL byte as the delimiter.' */ @@ -547,7 +547,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c break; case OUTPUT_DELIMITER_OPTION: -@@ -744,6 +1131,7 @@ main (int argc, char **argv) +@@ -744,6 +1135,7 @@ main (int argc, char **argv) break; case 'n': @@ -555,7 +555,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c break; case 's': -@@ -783,15 +1171,34 @@ main (int argc, char **argv) +@@ -783,15 +1175,34 @@ main (int argc, char **argv) } if (!delim_specified) @@ -3245,8 +3245,8 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c + + if (ignore || translate) + { -+ char *copy_a = (char *) xmalloc (lena + 1 + lenb + 1); -+ char *copy_b = copy_a + lena + 1; ++ char *copy_a = (char *) xmalloc ((lena + lenb) * MB_CUR_MAX + 2); ++ char *copy_b = copy_a + lena * MB_CUR_MAX + 1; + size_t new_len_a, new_len_b; + size_t i, j; + @@ -3342,7 +3342,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c /* Compare two lines A and B, returning negative, zero, or positive depending on whether A compares less than, equal to, or greater than B. */ -@@ -2722,7 +3347,7 @@ compare (struct line const *a, struct li +@@ -2722,7 +3365,7 @@ compare (struct line const *a, struct li diff = - NONZERO (blen); else if (blen == 0) diff = 1; @@ -3351,7 +3351,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c { /* Note xmemcoll0 is a performance enhancement as it will not unconditionally write '\0' after the -@@ -4113,6 +4738,7 @@ set_ordering (char const *s, struct keyf +@@ -4113,6 +4756,7 @@ set_ordering (char const *s, struct keyf break; case 'f': key->translate = fold_toupper; @@ -3359,7 +3359,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c break; case 'g': key->general_numeric = true; -@@ -4190,7 +4816,7 @@ main (int argc, char **argv) +@@ -4190,7 +4834,7 @@ main (int argc, char **argv) initialize_exit_failure (SORT_FAILURE); hard_LC_COLLATE = hard_locale (LC_COLLATE); @@ -3368,7 +3368,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c hard_LC_TIME = hard_locale (LC_TIME); #endif -@@ -4211,6 +4837,29 @@ main (int argc, char **argv) +@@ -4211,6 +4855,29 @@ main (int argc, char **argv) thousands_sep = -1; } @@ -3398,7 +3398,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c have_read_stdin = false; inittables (); -@@ -4485,13 +5134,34 @@ main (int argc, char **argv) +@@ -4485,13 +5152,34 @@ main (int argc, char **argv) case 't': { @@ -3437,7 +3437,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c else { /* Provoke with 'sort -txx'. Complain about -@@ -4502,9 +5172,12 @@ main (int argc, char **argv) +@@ -4502,9 +5190,12 @@ main (int argc, char **argv) quote (optarg)); } } @@ -3452,6 +3452,39 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c } break; +diff -urNp coreutils-8.23-orig/tests/i18n/sort.sh coreutils-8.23/tests/i18n/sort.sh +--- coreutils-8.23-orig/tests/i18n/sort.sh 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-8.23/tests/i18n/sort.sh 2014-07-22 13:45:52.733652016 +0200 +@@ -0,0 +1,29 @@ ++#!/bin/sh ++# Verify sort's multi-byte support. ++ ++. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src ++print_ver_ sort ++ ++export LC_ALL=en_US.UTF-8 ++locale -k LC_CTYPE | grep -q "charmap.*UTF-8" \ ++ || skip_ "No UTF-8 locale available" ++ ++# Enable heap consistency checkng on older systems ++export MALLOC_CHECK_=2 ++ ++ ++# check buffer overflow issue due to ++# expanding multi-byte representation due to case conversion ++# https://bugzilla.suse.com/show_bug.cgi?id=928749 ++cat < exp ++. ++ɑ ++EOF ++cat < out || fail=1 ++. ++ɑ ++EOF ++compare exp out || { fail=1; cat out; } ++ ++ ++Exit $fail diff -urNp coreutils-8.22-orig/src/unexpand.c coreutils-8.22/src/unexpand.c --- coreutils-8.22-orig/src/unexpand.c 2013-12-04 15:48:30.000000000 +0100 +++ coreutils-8.22/src/unexpand.c 2014-01-08 13:55:56.126375271 +0100 @@ -4099,11 +4132,12 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c diff -urNp coreutils-8.22-orig/tests/local.mk coreutils-8.22/tests/local.mk --- coreutils-8.22-orig/tests/local.mk 2014-01-08 13:55:24.524683837 +0100 +++ coreutils-8.22/tests/local.mk 2014-01-08 13:55:56.129375241 +0100 -@@ -324,6 +324,7 @@ all_tests = \ +@@ -325,6 +325,8 @@ all_tests = \ tests/misc/sort-discrim.sh \ tests/misc/sort-files0-from.pl \ tests/misc/sort-float.sh \ + tests/misc/sort-mb-tests.sh \ ++ tests/i18n/sort.sh \ tests/misc/sort-merge.pl \ tests/misc/sort-merge-fdlimit.sh \ tests/misc/sort-month.sh \ @@ -4469,7 +4503,7 @@ diff -urNp coreutils-8.22-orig/tests/misc/sort.pl coreutils-8.22/tests/misc/sort ["no-file1", 'no-file', {EXIT=>2}, {ERR=>$no_file}], # This test failed until 1.22f. Sort didn't give an error. # From Will Edgington. -@@ -415,6 +420,38 @@ foreach my $t (@Tests) +@@ -415,6 +424,38 @@ foreach my $t (@Tests) } } @@ -4508,7 +4542,7 @@ diff -urNp coreutils-8.22-orig/tests/misc/sort.pl coreutils-8.22/tests/misc/sort @Tests = triple_test \@Tests; # Remember that triple_test creates from each test with exactly one "IN" -@@ -424,6 +460,7 @@ foreach my $t (@Tests) +@@ -424,6 +465,7 @@ foreach my $t (@Tests) # Remove the IN_PIPE version of the "output-is-input" test above. # The others aren't susceptible because they have three inputs each. @Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests; diff --git a/coreutils.spec b/coreutils.spec index 71d0880..b797da9 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -381,6 +381,8 @@ fi %changelog * Thu May 14 2015 Kamil Dudka - 8.22-22 +- sort - fix buffer overflow in some case conversions + - patch by Pádraig Brady - Adjust LS_COLORS in 256 color mode; brighten some, remove hardlink colors (#1196642) - Drop large ancient docs - have the LC_TIME subdirs with lang macro (#1169027)