Skip to content

Commit 20bf416

Browse files
Merge pull request #317 from guidovranken/zd11621
In ReceiveScpConfirmation reserve room for NULL-terminator.
2 parents 3647697 + 2e6c670 commit 20bf416

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/wolfscp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,13 +1454,13 @@ int ReceiveScpConfirmation(WOLFSSH* ssh)
14541454
{
14551455
int ret = WS_SUCCESS;
14561456
int msgSz;
1457-
byte msg[DEFAULT_SCP_MSG_SZ];
1457+
byte msg[DEFAULT_SCP_MSG_SZ + 1];
14581458

14591459
if (ssh == NULL)
14601460
return WS_BAD_ARGUMENT;
14611461

14621462
WMEMSET(msg, 0, sizeof(msg));
1463-
msgSz = wolfSSH_stream_read(ssh, msg, sizeof(msg));
1463+
msgSz = wolfSSH_stream_read(ssh, msg, DEFAULT_SCP_MSG_SZ);
14641464

14651465
if (msgSz < 0) {
14661466
ret = msgSz;

0 commit comments

Comments
 (0)