Merge pull request #90 from JacobBarthelmeh/fuzz

fix for possible overflow with sanity check
pull/91/head
John Safranek 2018-08-14 10:38:37 -07:00 committed by GitHub
commit 1a0be6492f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2204,7 +2204,7 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
begin = *idx;
pubKey = buf + begin;
ret = GetUint32(&pubKeySz, buf, len, &begin);
if (ret == WS_SUCCESS && (pubKeySz + LENGTH_SZ + begin > len)) {
if (ret == WS_SUCCESS && (pubKeySz > len - LENGTH_SZ - begin )) {
ret = WS_BUFFER_E;
}