aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-07-07 11:37:52 +0200
committerMattias Andrée <maandree@kth.se>2022-07-07 11:37:52 +0200
commit6f96368d8620345a98e148436b96f4262ca73972 (patch)
tree7bff7bc8c08790a524e1d5a7446524e14bc0c255 /common.h
parentAdd coverage test (diff)
downloadlibsha1-6f96368d8620345a98e148436b96f4262ca73972.tar.gz
libsha1-6f96368d8620345a98e148436b96f4262ca73972.tar.bz2
libsha1-6f96368d8620345a98e148436b96f4262ca73972.tar.xz
Use malloc by default but allow bounded alloca
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'common.h')
-rw-r--r--common.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/common.h b/common.h
index ad3be05..864082c 100644
--- a/common.h
+++ b/common.h
@@ -4,11 +4,17 @@
#include <sys/stat.h>
#include <alloca.h>
#include <errno.h>
+#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <unistd.h>
+#ifndef ALLOCA_LIMIT
+# define ALLOCA_LIMIT 0
+#endif
+
+
/**
* Process a chunk using SHA-1 or SHA-0
*