There are two ways to get an invalid date through the range checking in DateTime.packDate():
1) BC date -- packDate() just checks the year of the date, ignoring the era -- so a date between 9999BC and 1753BC will pass validation
2) Date which overflows a short -- e.g. the year 67536, which will turn into 2000 when cast to a short in DateTime.
I am attaching a testcase and fix for the two issues -- can break this out separately if need be.
Note that this patch is built upon the patch from http://sourceforge.net/tracker2/?func=detail&aid=2181003&group_id=33291&atid=407762 -- I can also make a clean patch if required.
Log in to post a comment.