diff --git a/src/internal.c b/src/internal.c index 274105922..6d0c269ca 100644 --- a/src/internal.c +++ b/src/internal.c @@ -9963,12 +9963,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