vJust fail if tm_mon is out of range for now XXXX this is wrong.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18522 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-10-17 12:47:33 +00:00
parent 5c6ed83cf3
commit 989b0b530f

View File

@@ -53,6 +53,10 @@ _der_timegm (struct tm *tm)
time_t res = 0;
unsigned i;
/* XXX this is wrong, needs to handle out of months, days, hours, min, sec */
if (tm->tm_mon < 0 || tm->tm_mon > 11)
return -1;
for (i = 70; i < tm->tm_year; ++i)
res += is_leap(i) ? 366 : 365;