aboutsummaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2016-09-21 15:47:40 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2016-09-21 15:47:40 +0000
commit5fca7e1f131a64b6d1af8d38ccbfce0b0fa93eb1 (patch)
treed54293d9285e508f1955d094451710e20990b23a /lib/libc
parent05761ebcf159cd0cde701f9139211da535710345 (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdtime/strptime.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c
index 9f9840820aa61..89703ec8be3c6 100644
--- a/lib/libc/stdtime/strptime.c
+++ b/lib/libc/stdtime/strptime.c
@@ -582,10 +582,16 @@ label:
i *= 10;
i += *buf - '0';
buf++;
+ } else if (len == 2) {
+ i *= 100;
+ break;
} else
return (NULL);
}
+ if (i > 1400 || (sign == -1 && i > 1200) ||
+ (i % 100) >= 60)
+ return (NULL);
tm->tm_hour -= sign * (i / 100);
tm->tm_min -= sign * (i % 100);
*GMTp = 1;