[openssh-commits] [openssh] 05/13: upstream: make parse_absolute_time() reject times before epoch
git+noreply at mindrot.org
git+noreply at mindrot.org
Fri Nov 27 08:18:21 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 407de08cb84fe354ffc6735f1728c41f205d7987
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Thu Nov 26 19:25:34 2026 +0000
upstream: make parse_absolute_time() reject times before epoch
Anthropic ANT-2026-X3MEZKOG
OpenBSD-Commit-ID: c227fe2e26a82a9ee24f9df07aadfe6c537080c1
---
misc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/misc.c b/misc.c
index fb3ec2bee..b1761fe97 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.223 2026/10/30 08:07:36 djm Exp $ */
+/* $OpenBSD: misc.c,v 1.224 2026/11/26 19:25:34 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2005-2020 Damien Miller. All rights reserved.
@@ -2625,6 +2625,9 @@ parse_absolute_time(const char *s, uint64_t *tp)
if ((tt = mktime(&tm)) == -1 && tm.tm_wday == -1)
return SSH_ERR_INVALID_FORMAT;
}
+ /* *tp is unsigned, so times before the epoch can't be represented */
+ if (tt < 0)
+ return SSH_ERR_INVALID_FORMAT;
/* success */
*tp = (uint64_t)tt;
return 0;
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list