[openssh-commits] [openssh] 01/02: upstream: Improve termination condition of while loop to compare

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Jun 11 23:35:24 AEST 2025


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

dtucker pushed a commit to branch master
in repository openssh.

commit 4b3d27032ba88dd089b721f3bbe3e4a8d23b4ae1
Author: dtucker at openbsd.org <dtucker at openbsd.org>
AuthorDate: Wed Jun 11 13:24:05 2025 +0000

    upstream: Improve termination condition of while loop to compare
    
    size_t's.  Assuming read() does what it's supposed to this shouldn't matter,
    but should be more robust.  Flagged by Coverity CID 470514, ok djm@
    
    OpenBSD-Commit-ID: d7b5ad60feb797b3464964b9ea67fd78fb9d6cc6
---
 readpass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/readpass.c b/readpass.c
index d42b1185d..5a88824b4 100644
--- a/readpass.c
+++ b/readpass.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readpass.c,v 1.71 2024/03/30 04:27:44 djm Exp $ */
+/* $OpenBSD: readpass.c,v 1.72 2025/06/11 13:24:05 dtucker Exp $ */
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  *
@@ -91,7 +91,7 @@ ssh_askpass(char *askpass, const char *msg, const char *env_hint)
 		if (r <= 0)
 			break;
 		len += r;
-	} while (sizeof(buf) - 1 - len > 0);
+	} while (len < sizeof(buf) - 1);
 	buf[len] = '\0';
 
 	close(p[0]);

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


More information about the openssh-commits mailing list