Check for invalid size of e

pull/225/head
Eric Blankenhorn 2019-12-04 14:04:36 -06:00
parent b8f18d9459
commit a69307752d
1 changed files with 7 additions and 0 deletions

View File

@ -2378,6 +2378,13 @@ static int DoKexDhInit(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
ret = GetUint32(&eSz, buf, len, &begin);
}
if (ret == WS_SUCCESS) {
/* Validate eSz */
if (eSz + begin > len) {
ret = WS_PARSE_E;
}
}
if (ret == WS_SUCCESS) {
e = buf + begin;
begin += eSz;