Skip to content

Commit 6b8b7d4

Browse files
sudipm-mukherjeegregkh
authored andcommitted
crypto: asymmetric_keys - remove always false comparison
commit 4dd17c9 upstream. hour, min and sec are unsigned int and they can never be less than zero. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5f8b236 commit 6b8b7d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crypto/asymmetric_keys/x509_cert_parser.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,9 @@ int x509_decode_time(time64_t *_t, size_t hdrlen,
546546
if (year < 1970 ||
547547
mon < 1 || mon > 12 ||
548548
day < 1 || day > mon_len ||
549-
hour < 0 || hour > 23 ||
550-
min < 0 || min > 59 ||
551-
sec < 0 || sec > 59)
549+
hour > 23 ||
550+
min > 59 ||
551+
sec > 59)
552552
goto invalid_time;
553553

554554
*_t = mktime64(year, mon, day, hour, min, sec);

0 commit comments

Comments
 (0)