X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=plugins%2Fsudoers%2Fgetdate.y;h=bd411a0adb1a1fd0812652d753ff492961c84e61;hb=e8db7f6eea9b35527ddd4532affabd18a30549b5;hp=13483ff31ff1459ad1a876991b27f3c22ea6a3e4;hpb=7a01b10fee894dea7ecb3252886912eab41e9693;p=debian%2Fsudo diff --git a/plugins/sudoers/getdate.y b/plugins/sudoers/getdate.y index 13483ff..bd411a0 100644 --- a/plugins/sudoers/getdate.y +++ b/plugins/sudoers/getdate.y @@ -100,7 +100,7 @@ static time_t yyRelSeconds; static int yyerror(char *s); static int yylex(void); -static int yyparse(void); + int yyparse(void); %} @@ -586,9 +586,8 @@ Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode) } DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) ? 29 : 28; - /* Checking for 2038 bogusly assumes that time_t is 32 bits. But - I'm too lazy to try to check for time_t overflow in another way. */ - if (Year < EPOCH || Year > 2038 + /* 32-bit time_t cannot represent years past 2038 */ + if (Year < EPOCH || (sizeof(time_t) == sizeof(int) && Year > 2038) || Month < 1 || Month > 12 /* Lint fluff: "conversion from long may lose accuracy" */ || Day < 1 || Day > DaysInMonth[(int)--Month])