fix for possible overflow with sanity check

pull/90/head
Jacob Barthelmeh 2018-08-13 10:39:15 -06:00
parent cea5d5664e
commit 962ee5a06b
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;
}