ProcessPeerCerts allocating memory for exts with OPENSSL_EXTRA properly

This commit is contained in:
Sean Parkinson
2019-11-19 13:03:20 +10:00
parent c9f7741dfb
commit f08dfb4afc

View File

@ -9956,12 +9956,21 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
#endif
args->idx += ctxSz;
#ifdef OPENSSL_EXTRA
/* allocate buffer for cert extensions */
args->exts = (buffer*)XMALLOC(sizeof(buffer) *
(ssl->verifyDepth + 1), ssl->heap, DYNAMIC_TYPE_CERT_EXT);
if (args->exts == NULL) {
ERROR_OUT(MEMORY_E, exit_ppc);
}
#else
/* allocate buffer for cert extensions */
args->exts = (buffer*)XMALLOC(sizeof(buffer) * MAX_CHAIN_DEPTH,
ssl->heap, DYNAMIC_TYPE_CERT_EXT);
if (args->exts == NULL) {
ERROR_OUT(MEMORY_E, exit_ppc);
}
#endif
}
#endif