mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 12:14:38 +02:00
sanity check before reading word16 from buffer
This commit is contained in:
@@ -2866,6 +2866,8 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* Get extension length and length check. */
|
/* Get extension length and length check. */
|
||||||
|
if ((i - begin) + OPAQUE16_LEN > helloSz)
|
||||||
|
return BUFFER_ERROR;
|
||||||
ato16(&input[i], &totalExtSz);
|
ato16(&input[i], &totalExtSz);
|
||||||
i += OPAQUE16_LEN;
|
i += OPAQUE16_LEN;
|
||||||
if ((i - begin) + totalExtSz > helloSz)
|
if ((i - begin) + totalExtSz > helloSz)
|
||||||
|
Reference in New Issue
Block a user