aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdtime/strptime.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2018-10-08 18:45:40 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2018-10-08 18:45:40 +0000
commit92cbfb6395fb0ff0a1ca7cdda52ce2be96c6f48f (patch)
tree5c6b057bc8b0e4f4a9a28fafa22c6d26787dae6b /lib/libc/stdtime/strptime.c
parentf3b515aea565140c93e77011516e9e3cbe7dc0d2 (diff)
downloadsrc-92cbfb6395fb0ff0a1ca7cdda52ce2be96c6f48f.tar.gz
src-92cbfb6395fb0ff0a1ca7cdda52ce2be96c6f48f.zip
Disallow zero day of month from strptime("%d").
It is required by POSIX, specified in our man page, and followed by Linux. PR: 232072 Reported by: miguel_tete17@hotmail.com Sponsored by: The FreeBSD Foundation Approved by: re (gjb) MFC after: 1 week
Notes
Notes: svn path=/head/; revision=339241
Diffstat (limited to 'lib/libc/stdtime/strptime.c')
-rw-r--r--lib/libc/stdtime/strptime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c
index 4db89efdad11..6214398f09e0 100644
--- a/lib/libc/stdtime/strptime.c
+++ b/lib/libc/stdtime/strptime.c
@@ -419,7 +419,7 @@ label:
i += *buf - '0';
len--;
}
- if (i > 31)
+ if (i == 0 || i > 31)
return (NULL);
tm->tm_mday = i;