Merge pull request #2487 from JacobBarthelmeh/Fuzzer

fix for infinite loop with CSR2
This commit is contained in:
David Garske
2019-09-30 10:38:26 -07:00
committed by GitHub

View File

@@ -3455,15 +3455,19 @@ static int TLSX_CSR2_Parse(WOLFSSL* ssl, byte* input, word16 length,
return BUFFER_ERROR;
ato16(input + offset, &size);
offset += OPAQUE16_LEN + size;
if (length - offset < size)
return BUFFER_ERROR;
offset += OPAQUE16_LEN + size;
/* skip request_extensions */
if (length - offset < OPAQUE16_LEN)
return BUFFER_ERROR;
ato16(input + offset, &size);
offset += OPAQUE16_LEN + size;
if (length - offset < size)
return BUFFER_ERROR;
offset += OPAQUE16_LEN + size;
if (offset > length)
return BUFFER_ERROR;