add sanity check for short read

This commit is contained in:
Jacob Barthelmeh
2018-03-02 09:38:11 -07:00
parent f6869dfe09
commit 223903717a

View File

@@ -2618,6 +2618,10 @@ static int TLSX_CSR2_Parse(WOLFSSL* ssl, byte* input, word16 length,
word16 size = 0;
/* list size */
if (offset + OPAQUE16_LEN >= length) {
return BUFFER_E;
}
ato16(input + offset, &request_length);
offset += OPAQUE16_LEN;