From f9fc2986373ffb7e5f18f60af70fc62fc7be689f Mon Sep 17 00:00:00 2001 From: aidan garske Date: Fri, 10 Jul 2026 12:17:59 -0700 Subject: [PATCH] F-4105 - Write only bytes read to Windows stdout handle --- apps/wolfssh/wolfssh.c | 2 +- examples/client/client.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/wolfssh/wolfssh.c b/apps/wolfssh/wolfssh.c index 63cb5c63..a22d8cc0 100644 --- a/apps/wolfssh/wolfssh.c +++ b/apps/wolfssh/wolfssh.c @@ -563,7 +563,7 @@ static THREAD_RET readPeer(void* in) buf[bufSz - 1] = '\0'; #ifdef USE_WINDOWS_API - if (WriteFile(stdoutHandle, buf, bufSz, &writtn, NULL) == FALSE) { + if (WriteFile(stdoutHandle, buf, (DWORD)ret, &writtn, NULL) == FALSE) { err_sys("Failed to write to stdout handle"); } #else diff --git a/examples/client/client.c b/examples/client/client.c index 5ab01b19..38e44672 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -546,7 +546,7 @@ static THREAD_RET readPeer(void* in) buf[bufSz - 1] = '\0'; #ifdef USE_WINDOWS_API - if (WriteFile(stdoutHandle, buf, bufSz, &writtn, NULL) == FALSE) { + if (WriteFile(stdoutHandle, buf, (DWORD)ret, &writtn, NULL) == FALSE) { err_sys("Failed to write to stdout handle"); } #else