[openssh-commits] [openssh] 03/05: upstream: Change types in convtime() unit test to int to match

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Jan 18 18:44:24 AEDT 2021


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

dtucker pushed a commit to branch master
in repository openssh.

commit 02da325f10b214219eae2bb1bc2d3bf0c2f13f9f
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Fri Jan 15 02:58:11 2021 +0000

    upstream: Change types in convtime() unit test to int to match
    
    change its new type. Add tests for boundary conditions and fix convtime to
    work up to INT_MAX. ok djm@
    
    OpenBSD-Commit-ID: 01dc0475f1484ac2f47facdfcf9221f9472145de
---
 misc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/misc.c b/misc.c
index 7aad1b5d..3835056a 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.159 2021/01/15 02:32:41 dtucker Exp $ */
+/* $OpenBSD: misc.c,v 1.160 2021/01/15 02:58:11 dtucker Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  * Copyright (c) 2005-2020 Damien Miller.  All rights reserved.
@@ -591,10 +591,10 @@ convtime(const char *s)
 		default:
 			return -1;
 		}
-		if (secs >= INT_MAX / multiplier)
+		if (secs > INT_MAX / multiplier)
 			return -1;
 		secs *= multiplier;
-		if  (total >= INT_MAX - secs)
+		if  (total > INT_MAX - secs)
 			return -1;
 		total += secs;
 		if (total < 0)

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


More information about the openssh-commits mailing list