[openssh-commits] [openssh] 01/18: upstream: correctly handle zero values when merging valid before

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Nov 25 19:55:56 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 d7feb6a0841ed86acd9c8587a55245c7a0308190
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Fri Nov 20 22:52:55 2026 +0000

    upstream: correctly handle zero values when merging valid before
    
    intervals
    
    a zero valid before value should be clobbered by any nonzero value
    
    OpenBSD-Commit-ID: 23f294316852ea647699e08fc3154b16f61566e0
---
 auth-options.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/auth-options.c b/auth-options.c
index 81fa4f68e..09ea4dfa2 100644
--- a/auth-options.c
+++ b/auth-options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-options.c,v 1.104 2026/10/30 00:58:02 djm Exp $ */
+/* $OpenBSD: auth-options.c,v 1.105 2026/11/20 22:52:55 djm Exp $ */
 /*
  * Copyright (c) 2018 Damien Miller <djm at mindrot.org>
  *
@@ -610,8 +610,8 @@ sshauthopt_merge(const struct sshauthopt *primary,
 	/* Earliest expiry time should win */
 	if (primary->valid_before != 0)
 		ret->valid_before = primary->valid_before;
-	if (additional->valid_before != 0 &&
-	    additional->valid_before < ret->valid_before)
+	if (additional->valid_before != 0 && (ret->valid_before == 0 ||
+	    additional->valid_before < ret->valid_before))
 		ret->valid_before = additional->valid_before;
 
 	/*

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


More information about the openssh-commits mailing list