In ReceiveScpConfirmation reserve room for NULL-terminator.

ZD 11621
pull/317/head
Guido Vranken 2021-02-02 13:24:07 +01:00
parent 3647697d46
commit 2e6c670769
1 changed files with 2 additions and 2 deletions

View File

@ -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;