From 2e6c6707691fc83bc591f04f8abe364a9fff8412 Mon Sep 17 00:00:00 2001 From: Guido Vranken Date: Tue, 2 Feb 2021 13:24:07 +0100 Subject: [PATCH] In ReceiveScpConfirmation reserve room for NULL-terminator. ZD 11621 --- src/wolfscp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wolfscp.c b/src/wolfscp.c index 625ccfe..38e61ed 100644 --- a/src/wolfscp.c +++ b/src/wolfscp.c @@ -1454,13 +1454,13 @@ int ReceiveScpConfirmation(WOLFSSH* ssh) { int ret = WS_SUCCESS; int msgSz; - byte msg[DEFAULT_SCP_MSG_SZ]; + byte msg[DEFAULT_SCP_MSG_SZ + 1]; if (ssh == NULL) return WS_BAD_ARGUMENT; WMEMSET(msg, 0, sizeof(msg)); - msgSz = wolfSSH_stream_read(ssh, msg, sizeof(msg)); + msgSz = wolfSSH_stream_read(ssh, msg, DEFAULT_SCP_MSG_SZ); if (msgSz < 0) { ret = msgSz;