mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
Fix to resolve the increased stack by allocating the temp ssl
from the heap.
This commit is contained in:
15
src/ssl.c
15
src/ssl.c
@ -11330,15 +11330,20 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
|
||||
|
||||
long wolfSSL_CTX_set_options(WOLFSSL_CTX* ctx, long opt)
|
||||
{
|
||||
WOLFSSL ssl;
|
||||
WOLFSSL* ssl;
|
||||
WOLFSSL_ENTER("SSL_CTX_set_options");
|
||||
|
||||
if (ctx == NULL)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
XMEMSET(&ssl, 0, sizeof(ssl));
|
||||
ssl.options.mask = ctx->mask;
|
||||
ctx->mask = wolfSSL_set_options(&ssl, opt);
|
||||
ssl = (WOLFSSL*)XMALLOC(sizeof(WOLFSSL), ctx->heap, DYNAMIC_TYPE_SSL);
|
||||
if (ssl == NULL)
|
||||
return MEMORY_E;
|
||||
|
||||
XMEMSET(ssl, 0, sizeof(WOLFSSL));
|
||||
ssl->options.mask = ctx->mask;
|
||||
ctx->mask = wolfSSL_set_options(ssl, opt);
|
||||
|
||||
XFREE(ssl, ctx->heap, DYNAMIC_TYPE_SSL);
|
||||
|
||||
return ctx->mask;
|
||||
}
|
||||
|
Reference in New Issue
Block a user