(parse822_time): Tolerate unknown timezone abbreviations.
Showing
1 changed file
with
6 additions
and
6 deletions
... | @@ -1606,16 +1606,16 @@ parse822_time (const char **p, const char *e, | ... | @@ -1606,16 +1606,16 @@ parse822_time (const char **p, const char *e, |
1606 | break; | 1606 | break; |
1607 | } | 1607 | } |
1608 | 1608 | ||
1609 | if (strspn (zp, "0123456789") != 4) | 1609 | if (strspn (zp, "0123456789") == 4) |
1610 | { | 1610 | { |
1611 | *p = save; | ||
1612 | str_free (&zone); | ||
1613 | return EPARSE; | ||
1614 | } | ||
1615 | /* convert to seconds from UTC */ | 1611 | /* convert to seconds from UTC */ |
1616 | hh = (zone[1] - '0') * 10 + (zone[2] - '0'); | 1612 | hh = (zone[1] - '0') * 10 + (zone[2] - '0'); |
1617 | mm = (zone[3] - '0') * 10 + (zone[4] - '0'); | 1613 | mm = (zone[3] - '0') * 10 + (zone[4] - '0'); |
1618 | 1614 | } | |
1615 | else | ||
1616 | { | ||
1617 | hh = mm = 0; /* Consider equivalent to -0000 */ | ||
1618 | } | ||
1619 | if (tz) | 1619 | if (tz) |
1620 | *tz = sign * (hh * 60 * 60 + mm * 60); | 1620 | *tz = sign * (hh * 60 * 60 + mm * 60); |
1621 | } | 1621 | } | ... | ... |
-
Please register or sign in to post a comment