Merge pull request #317 from guidovranken/zd11621

In ReceiveScpConfirmation reserve room for NULL-terminator.
pull/318/head
JacobBarthelmeh 2021-02-02 23:15:06 +07:00 committed by GitHub
commit 20bf416afd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;