mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +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)
|
long wolfSSL_CTX_set_options(WOLFSSL_CTX* ctx, long opt)
|
||||||
{
|
{
|
||||||
WOLFSSL ssl;
|
WOLFSSL* ssl;
|
||||||
WOLFSSL_ENTER("SSL_CTX_set_options");
|
WOLFSSL_ENTER("SSL_CTX_set_options");
|
||||||
|
|
||||||
if (ctx == NULL)
|
if (ctx == NULL)
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
|
|
||||||
XMEMSET(&ssl, 0, sizeof(ssl));
|
ssl = (WOLFSSL*)XMALLOC(sizeof(WOLFSSL), ctx->heap, DYNAMIC_TYPE_SSL);
|
||||||
ssl.options.mask = ctx->mask;
|
if (ssl == NULL)
|
||||||
ctx->mask = wolfSSL_set_options(&ssl, opt);
|
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;
|
return ctx->mask;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user