time.c: check year range before creating Time object.

parent 9f012724
......@@ -459,7 +459,7 @@ time_mktime(mrb_state *mrb, mrb_int ayear, mrb_int amonth, mrb_int aday,
#define OUTINT(x) 0
#endif
if (OUTINT(ayear-1900) ||
if (ayear < 1900 || OUTINT(ayear-1900) ||
amonth < 1 || amonth > 12 ||
aday < 1 || aday > 31 ||
ahour < 0 || ahour > 24 ||
......
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