mirror of https://github.com/wolfSSL/wolfssh.git
Check for invalid size of e
parent
b8f18d9459
commit
a69307752d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue