]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: check for convtime() refusing to accept times that
authordjm@openbsd.org <djm@openbsd.org>
Fri, 14 Jun 2019 04:03:48 +0000 (04:03 +0000)
committerDamien Miller <djm@mindrot.org>
Wed, 19 Jun 2019 02:21:40 +0000 (12:21 +1000)
resolve to LONG_MAX Reported by Kirk Wolf bz2977; ok dtucker

OpenBSD-Regress-ID: 15c9fe87be1ec241d24707006a31123d3a3117e0

regress/unittests/conversion/tests.c

index 6dd77ef42548bb09e0cb82819deddcae217abfea..ae1154d429df791f48c323b7bde2d74c45679a49 100644 (file)
@@ -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
  *
@@ -40,6 +40,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);