[openssh-commits] [openssh] 03/03: upstream: If write() returned short, the subsequent write would restart

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Oct 6 12:19:03 AEDT 2025


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

djm pushed a commit to branch master
in repository openssh.

commit b9a640a1a0dccfb56be684cc7ade402f57cf7ebd
Author: dtucker at openbsd.org <dtucker at openbsd.org>
AuthorDate: Fri Oct 3 01:03:45 2025 +0000

    upstream: If write() returned short, the subsequent write would restart
    
    from the beginning of the buffer not the end of what was written.  Fix, since
    we want modpipe to corrupt data for testing purposes deliberately not
    accidentally.  ok djm@
    
    OpenBSD-Regress-ID: 50ca74d287445c58944f070bb92dc13b1d054b43
---
 regress/modpipe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/regress/modpipe.c b/regress/modpipe.c
index 5f4824b51..5ef2f12ed 100644
--- a/regress/modpipe.c
+++ b/regress/modpipe.c
@@ -14,7 +14,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $OpenBSD: modpipe.c,v 1.6 2013/11/21 03:16:47 djm Exp $ */
+/* $OpenBSD: modpipe.c,v 1.7 2025/10/03 01:03:45 dtucker Exp $ */
 
 #include "includes.h"
 
@@ -127,7 +127,7 @@ main(int argc, char **argv)
 			}
 		}
 		for (o = 0; o < s; o += r) {
-			r = write(STDOUT_FILENO, buf, s - o);
+			r = write(STDOUT_FILENO, buf + o, s - o);
 			if (r == 0)
 				break;
 			if (r < 0) {

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


More information about the openssh-commits mailing list