Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cups/http-support.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,10 @@ httpGetDateTime(const char *s) // I - Date/time string
DEBUG_printf("4httpGetDateTime: day=%d, mon=\"%s\", year=%d, hour=%d, min=%d, sec=%d", day, mon, year, hour, min, sec);

// Check for invalid year (RFC 7231 says it's 4DIGIT)
if (year > 9999)
if (year < 0 || year > 9999)
return (0);

if (day < 1 || day > 31 || hour < 0 || hour > 23 || min < 0 || min > 59 || sec < 0 || sec > 60)
return (0);

// Convert the month name to a number from 0 to 11.
Expand Down