Sanity check size in TLSX_Parse

This commit is contained in:
Eric Blankenhorn
2021-03-24 09:33:03 -05:00
parent 3accd4dd86
commit 11189fe386

View File

@@ -11043,7 +11043,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) {