diff options
author | wtc%google.com <devnull@localhost> | 2007-08-08 01:56:31 +0000 |
---|---|---|
committer | wtc%google.com <devnull@localhost> | 2007-08-08 01:56:31 +0000 |
commit | d228b6ae89a7e338cca326c2312628f55f1c40a7 (patch) | |
tree | 3bce7980beb7f6c9a4185589d2e708753459f7f5 | |
parent | 8b9692ea1393afc5bc59e3a7ecf7a585e5711059 (diff) | |
download | nspr-hg-d228b6ae89a7e338cca326c2312628f55f1c40a7.tar.gz |
Bug 364334: reject too much junk at the end of a date/time string.
Fixed a typo that makes us fail to parse "AST" as a timezone. The
patch is contributed by Mats Palmgren <mats.palmgren@bredband.net>.
r=wtc.
-rw-r--r-- | pr/src/misc/prtime.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/pr/src/misc/prtime.c b/pr/src/misc/prtime.c index 94c40443..4212a48c 100644 --- a/pr/src/misc/prtime.c +++ b/pr/src/misc/prtime.c @@ -1012,9 +1012,7 @@ PR_ParseTimeStringToExplodedTime( const char *rest = string; -#ifdef DEBUG int iterations = 0; -#endif PR_ASSERT(string && result); if (!string || !result) return PR_FAILURE; @@ -1022,13 +1020,10 @@ PR_ParseTimeStringToExplodedTime( while (*rest) { -#ifdef DEBUG if (iterations++ > 1000) { - PR_ASSERT(0); return PR_FAILURE; } -#endif switch (*rest) { @@ -1038,7 +1033,7 @@ PR_ParseTimeStringToExplodedTime( (rest[2] == 'r' || rest[2] == 'R')) month = TT_APR; else if (zone == TT_UNKNOWN && - (rest[1] == 's' || rest[1] == 's') && + (rest[1] == 's' || rest[1] == 'S') && (rest[2] == 't' || rest[2] == 'T')) zone = TT_AST; else if (month == TT_UNKNOWN && |