strptime: disallow zero hour for %I (defined by POSIX as [01,12]) and %l
(extension, defined in strftime(3) as 1-12). Approved by: re (gjb), kib (mentor) Differential Revision: https://reviews.freebsd.org/D17543
This commit is contained in:
parent
84cf7c1df7
commit
cbc0062992
@ -291,7 +291,7 @@ label:
|
||||
if (c == 'H' || c == 'k') {
|
||||
if (i > 23)
|
||||
return (NULL);
|
||||
} else if (i > 12)
|
||||
} else if (i == 0 || i > 12)
|
||||
return (NULL);
|
||||
|
||||
tm->tm_hour = i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user