]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Document and add a test for today's sort bug fix.
authorJim Meyering <jim@meyering.net>
Fri, 20 Jul 2007 16:42:23 +0000 (18:42 +0200)
committerJim Meyering <jim@meyering.net>
Fri, 20 Jul 2007 16:42:23 +0000 (18:42 +0200)
* NEWS: Describe the bug fix.
* tests/sort/Test.pm (obs-inval): Add a test for today's fix.

ChangeLog
NEWS
tests/sort/Test.pm

index ee816767283bbab36060b1f2beb31214607cdf47..c7ba8316b52d249c784a53ca2be11552972cc231 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-07-20  Jim Meyering  <jim@meyering.net>
+
+       Document and add a test for today's sort bug fix.
+       * NEWS: Describe the bug fix.
+       * tests/sort/Test.pm (obs-inval): Add a test for today's fix.
+
 2007-07-20  Andreas Schwab  <schwab@suse.de>
 
        * src/sort.c (main): Don't free a pointer to non-malloc'd memory.
diff --git a/NEWS b/NEWS
index 423cf498b001db4567f425ba4b13c80cee2ffc78..dff643ff38d58cbfd31cfc7e3048c53faf67a3e4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -115,6 +115,9 @@ GNU coreutils NEWS                                    -*- outline -*-
   Using pr -m -s (i.e. merging files, with TAB as the output separator)
   no longer inserts extraneous spaces between output columns.
 
+  Obsolete sort usage with an invalid ordering-option character, e.g.,
+  "env _POSIX2_VERSION=199209 sort +1x" no longer makes sort free an
+  invalid pointer [introduced in coreutils-6.5]
 
 * Noteworthy changes in release 6.8 (2007-02-24) [not-unstable]
 
index 8b160bddb75d6844b198afa33d5003609ecac658..22e1ea42a1548fa7d6c412f03024caa6ddc29b63 100755 (executable)
@@ -1,8 +1,7 @@
 # -*-perl-*-
 # Test "sort".
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
-# 2006 Free Software Foundation, Inc.
+# Copyright (C) 1996-1999, 2001-2007 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -282,6 +281,11 @@ my @tv = (
 
 ["bigfield", '-k 340282366920938463463374607431768211456',
  "2\n1\n", "1\n2\n", 0],
+
+# Using an old-style key-specifying option like +1 with an invalid
+# ordering-option character would cause sort to try to free an invalid
+# (non-malloc'd) pointer.  This bug affects coreutils-6.5 through 6.9.
+['obs-inval', '+1x', '', '', 2]
 );
 
 sub test_vector