forked from wolfSSL/wolfssl
Merge pull request #6920 from embhorn/zd16909
Fix mem leak in TLSX_CA_Names_Parse
This commit is contained in:
16
src/tls.c
16
src/tls.c
@@ -6677,13 +6677,17 @@ static int TLSX_CA_Names_Parse(WOLFSSL *ssl, const byte* input,
|
|||||||
DecodedCert cert[1];
|
DecodedCert cert[1];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (length < OPAQUE16_LEN)
|
if (length < OPAQUE16_LEN) {
|
||||||
return BUFFER_ERROR;
|
|
||||||
ato16(input, &extLen);
|
|
||||||
idx += OPAQUE16_LEN;
|
|
||||||
|
|
||||||
if (idx + extLen > length)
|
|
||||||
ret = BUFFER_ERROR;
|
ret = BUFFER_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret == 0) {
|
||||||
|
ato16(input, &extLen);
|
||||||
|
idx += OPAQUE16_LEN;
|
||||||
|
|
||||||
|
if (idx + extLen > length)
|
||||||
|
ret = BUFFER_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
InitDecodedCert(cert, input + idx, extLen, ssl->heap);
|
InitDecodedCert(cert, input + idx, extLen, ssl->heap);
|
||||||
|
Reference in New Issue
Block a user