summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-01-18 14:05:33 +0100
committerRichard Levitte <levitte@openssl.org>2018-01-18 14:05:33 +0100
commite44c7d02ddac975ec6abff7901e77a0c37f9949d (patch)
tree810553d9ee0ee01d6afa888919d04178c8bb1d67 /crypto
parent4d3c278c1a4f940e098edac6de3d370b94d1bb8b (diff)
Only implement secure malloc if _POSIX_VERSION allows
Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5060)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/mem_sec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/mem_sec.c b/crypto/mem_sec.c
index 0c24ed819b..87c19a1395 100644
--- a/crypto/mem_sec.c
+++ b/crypto/mem_sec.c
@@ -20,7 +20,9 @@
#include <string.h>
-#if defined(OPENSSL_SYS_LINUX) || defined(OPENSSL_SYS_UNIX)
+/* e_os.h includes unistd.h, which defines _POSIX_VERSION */
+#if defined(OPENSSL_SYS_UNIX) \
+ && defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L
# define IMPLEMENTED
# include <stdlib.h>
# include <assert.h>