]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
date: fix crash or infinite loop when parsing a malformed TZ=""
authorPádraig Brady <P@draigBrady.com>
Thu, 27 Feb 2014 23:43:34 +0000 (23:43 +0000)
committerPádraig Brady <P@draigBrady.com>
Thu, 27 Feb 2014 23:56:28 +0000 (23:56 +0000)
* NEWS: Mention the fix.
* gnulib: Update to incorporate the fix.
This is the only change in this gnulib update.
* tests/misc/date.pl: Add a test for this case.

Fixes http://bugs.gnu.org/16872

NEWS
gnulib
tests/misc/date.pl

diff --git a/NEWS b/NEWS
index be8311f491bf9b217f88f328965d92a7df083ce0..d86778473996e87584c1f70a3ac858a380a139fa 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,9 @@ GNU coreutils NEWS                                    -*- outline -*-
   when reading the SELinux context for a file.
   [bug introduced in coreutils-8.22]
 
+  date could crash or go into an infinite loop when parsing a malformed TZ="".
+  [bug introduced with the --date='TZ="" ..' parsing feature in coreutils-5.3.0]
+
   head --lines=-0, when the input does not contain a trailing '\n',
   now copies all input to stdout.  Previously nothing was output in this case.
   [bug introduced with the --lines=-N feature in coreutils-5.0.1]
diff --git a/gnulib b/gnulib
index 1c6bf3d204c0cbd664590bbdc30fdf756d9fdb65..a10acfb1d2118f9a180181d3fed5399dbbe1df3c 160000 (submodule)
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 1c6bf3d204c0cbd664590bbdc30fdf756d9fdb65
+Subproject commit a10acfb1d2118f9a180181d3fed5399dbbe1df3c
index 57c6c7282bd7b7e323839ae4b7a7057eb7497715..40be4cab5d7f122de50b6392ff73049a14ab23d7 100755 (executable)
@@ -287,6 +287,13 @@ my @Tests =
       {ERR => "date: invalid date '\\260'\n"},
       {EXIT => 1},
      ],
+
+     # From coreutils-5.3.0 to 8.22 inclusive
+     # this would either infinite loop or crash
+     ['invalid-TZ-crash', "-d 'TZ=\"\"\"'",
+      {ERR => "date: invalid date 'TZ=\"\"\"'\n"},
+      {EXIT => 1},
+     ],
     );
 
 # Repeat the cross-dst test, using Jan 1, 2005 and every interval from 1..364.