Merge pull request #144 from JacobBarthelmeh/testing

sanity check on size returned
pull/145/head
John Safranek 2019-03-22 13:56:38 -07:00 committed by GitHub
commit 0ca04e4248
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -1500,8 +1500,15 @@ static int GetInputData(WOLFSSH* ssh, word32 size)
return WS_FATAL_ERROR;
}
ssh->inputBuffer.length += in;
inSz -= in;
if (in >= 0) {
ssh->inputBuffer.length += in;
inSz -= in;
}
else {
/* all other unexpected negative values is a failure case */
ssh->error = WS_FATAL_ERROR;
return WS_FATAL_ERROR;
}
} while (ssh->inputBuffer.length < size);