[openssh-commits] [openssh] 11/13: upstream: check parse_absolute_time() with times before epoch

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Nov 27 08:18:27 AEDT 2026


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 069c6b356dc384fd8bcb0aea80473524a6f120cc
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Thu Nov 26 19:27:26 2026 +0000

    upstream: check parse_absolute_time() with times before epoch
    
    Anthropic ANT-2026-X3MEZKOG
    
    OpenBSD-Regress-ID: e371c45ee2ca51ecda10072c0126d53136615b7e
---
 regress/unittests/misc/test_convtime.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/regress/unittests/misc/test_convtime.c b/regress/unittests/misc/test_convtime.c
index 83af8c8c8..314179517 100644
--- a/regress/unittests/misc/test_convtime.c
+++ b/regress/unittests/misc/test_convtime.c
@@ -1,4 +1,4 @@
-/* 	$OpenBSD: test_convtime.c,v 1.4 2025/12/05 07:43:24 djm Exp $ */
+/* 	$OpenBSD: test_convtime.c,v 1.5 2026/11/26 19:27:26 djm Exp $ */
 /*
  * Regress test for misc time conversion functions.
  *
@@ -149,6 +149,16 @@ test_convtime(void)
 	    SSH_ERR_INVALID_FORMAT);
 	ASSERT_INT_EQ(parse_absolute_time("20000101UTCUTC", &t),
 	    SSH_ERR_INVALID_FORMAT);
+	/* Before the epoch */
+	ASSERT_INT_EQ(parse_absolute_time("19691231", &t),
+	    SSH_ERR_INVALID_FORMAT);
+	ASSERT_INT_EQ(parse_absolute_time("19691231Z", &t),
+	    SSH_ERR_INVALID_FORMAT);
+	ASSERT_INT_EQ(parse_absolute_time("19691231235959UTC", &t),
+	    SSH_ERR_INVALID_FORMAT);
+	/* Epoch itself */
+	ASSERT_INT_EQ(parse_absolute_time("19700101Z", &t), 0);
+	ASSERT_U64_EQ(t, 0);
 
 	TEST_DONE();
 }

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list