]> Savannah Git Hosting - gnulib.git/commit
parse-datetime: fix crash or infloop in TZ="" parsing
authorPádraig Brady <P@draigBrady.com>
Tue, 25 Feb 2014 10:58:48 +0000 (10:58 +0000)
committerPádraig Brady <P@draigBrady.com>
Thu, 27 Feb 2014 23:15:43 +0000 (23:15 +0000)
commita10acfb1d2118f9a180181d3fed5399dbbe1df3c
treec52ab765a57399e3a1488deb7197716b3f5538d4
parent1c6bf3d204c0cbd664590bbdc30fdf756d9fdb65
parse-datetime: fix crash or infloop in TZ="" parsing

This was reported in http://bugs.gnu.org/16872
from the coreutils command: date -d 'TZ="""'

The infinite loop for this case was present since the
initial TZ="" parsing support in commit de95bdc2 29-10-2004.
This was changed to a crash or heap corruption depending
on the platform with commit 2e3e4195 18-01-2010.

* lib/parse-datetime.y (parse_datetime): Break out of the
TZ="" parsing loop once the second significant " is found.
Also skip over any subsequent whitespace to be consistent
with the non TZ= case.
* tests/test-parse-datetime.c: Add test cases for TZ="" parsing.
ChangeLog
lib/parse-datetime.y
tests/test-parse-datetime.c