Merge pull request #3908 from embhorn/zd11866

Sanity check size in TLSX_Parse
This commit is contained in:
toddouska 2021-04-07 16:34:56 -07:00 committed by GitHub
commit 3b9e7942ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11049,7 +11049,7 @@ int TLSX_Parse(WOLFSSL* ssl, const byte* input, word16 length, byte msgType,
ato16(input + offset, &size);
offset += OPAQUE16_LEN;
if (offset + size > length)
if (length - offset < size)
return BUFFER_ERROR;
switch (type) {