async_posix: raise a memory allocation error if we fail to allocate stack memory
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 23 Feb 2022 18:56:36 +0000 (13:56 -0500)
committerMatt Caswell <matt@openssl.org>
Thu, 10 Mar 2022 13:54:07 +0000 (13:54 +0000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17762)

crypto/async/arch/async_posix.c

index e107e09a352f552d0dff20a5e4811dcad84bd612..a0ac97783fad7099d90cb9fb9299e37a475fc989 100644 (file)
@@ -14,6 +14,7 @@
 
 # include <stddef.h>
 # include <unistd.h>
+# include <openssl/err.h>
 
 #define STACKSIZE       32768
 
@@ -45,6 +46,7 @@ int async_fibre_makecontext(async_fibre *fibre)
             makecontext(&fibre->fibre, async_start_func, 0);
             return 1;
         }
+        ERR_raise(ERR_LIB_ASYNC, ERR_R_MALLOC_FAILURE);
     } else {
         fibre->fibre.uc_stack.ss_sp = NULL;
     }