diff options
author | Mattias Andrée <maandree@kth.se> | 2021-07-27 16:01:30 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-07-27 16:07:05 +0200 |
commit | 411e0a694f3ed02e1d98abe923601d511bc15b59 (patch) | |
tree | 887856fdaf376eec294c8ef4492c26e66fe977c7 /common.h | |
parent | Improve makefile (diff) | |
download | libkeccak-411e0a694f3ed02e1d98abe923601d511bc15b59.tar.gz libkeccak-411e0a694f3ed02e1d98abe923601d511bc15b59.tar.bz2 libkeccak-411e0a694f3ed02e1d98abe923601d511bc15b59.tar.xz |
Add ALLOCA_LIMIT to fix bug #13 on GitHub reported by Justin Gottula
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'common.h')
-rw-r--r-- | common.h | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -2,13 +2,20 @@ #include "libkeccak.h" +#ifndef ALLOCA_LIMIT +# define ALLOCA_LIMIT (16UL << 10) +#endif + + #include <sys/stat.h> -#if defined(__GLIBC__) || defined(__sun) || defined(__CYGWIN__) -# include <alloca.h> -#elif defined(_WIN32) -# include <malloc.h> -# if !defined(alloca) -# define alloca _alloca /* For clang with MS Codegen */ +#if ALLOCA_LIMIT > 0 +# if defined(__GLIBC__) || defined(__sun) || defined(__CYGWIN__) +# include <alloca.h> +# elif defined(_WIN32) +# include <malloc.h> +# if !defined(alloca) +# define alloca _alloca /* For clang with MS Codegen */ +# endif # endif #endif #include <errno.h> |