Skip to content

Commit 5b386d3

Browse files
committed
Add more range checking to httpGetDateTime (Issue #1717)
1 parent 6c61d23 commit 5b386d3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎cups/http-support.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,10 @@ httpGetDateTime(const char *s) /* I - Date/time string */
850850
* Check for invalid year (RFC 7231 says it's 4DIGIT)
851851
*/
852852

853-
if (year > 9999)
853+
if (year < 0 || year > 9999)
854+
return (0);
855+
856+
if (day < 1 || day > 31 || hour < 0 || hour > 23 || min < 0 || min > 59 || sec < 0 || sec > 60)
854857
return (0);
855858

856859
/*

0 commit comments

Comments
 (0)