Commit 99e11315 authored by Guido van Rossum's avatar Guido van Rossum

Avoid crash in parsedate_tz() on certain invalid dates -- when the

field assumed to be the time is in fact the year, the resulting list
doesn't have enough items, and this isn't checked for.  Return None
instead.
parent 2d3b0d72
......@@ -800,8 +800,10 @@ def parsedate_tz(data):
if len(tm) == 2:
[thh, tmm] = tm
tss = '0'
else:
elif len(tm) == 3:
[thh, tmm, tss] = tm
else:
return None
try:
yy = string.atoi(yy)
dd = string.atoi(dd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment