diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2019-06-14 04:03:49 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2019-06-14 04:03:49 +0000 |
commit | fba3951af661f5825788f6c14801b69e087941fc (patch) | |
tree | 76dfb3258a5c92a9a3ccf3bacb5e0950964bd5e7 /regress | |
parent | c8f941b34e43885f53cec055c1043a86413d653b (diff) |
check for convtime() refusing to accept times that resolve to LONG_MAX
Reported by Kirk Wolf bz2977; ok dtucker
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.bin/ssh/unittests/conversion/tests.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/regress/usr.bin/ssh/unittests/conversion/tests.c b/regress/usr.bin/ssh/unittests/conversion/tests.c index ebd7bde0049..f97e37efc66 100644 --- a/regress/usr.bin/ssh/unittests/conversion/tests.c +++ b/regress/usr.bin/ssh/unittests/conversion/tests.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tests.c,v 1.1 2017/03/14 01:20:29 dtucker Exp $ */ +/* $OpenBSD: tests.c,v 1.2 2019/06/14 04:03:48 djm Exp $ */ /* * Regress test for conversions * @@ -36,6 +36,8 @@ tests(void) ASSERT_LONG_EQ(convtime("-9d"), -1); /* overflow */ + snprintf(buf, sizeof buf, "%llu", (unsigned long long)LONG_MAX); + ASSERT_LONG_EQ(convtime(buf), -1); snprintf(buf, sizeof buf, "%llu", (unsigned long long)LONG_MAX + 1); ASSERT_LONG_EQ(convtime(buf), -1); |