summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/mem.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2004-04-08 08:03:11 +0000
committermarkus <markus@openbsd.org>2004-04-08 08:03:11 +0000
commit6278d0304dd1b39e46a509fa3953ad2d0b67fb9d (patch)
treedbc442beb7920ec3d30578fe90f92fb8264f34e9 /lib/libcrypto/mem.c
parent-l can overwrite the path to the leases file, noticed by millert (diff)
downloadwireguard-openbsd-6278d0304dd1b39e46a509fa3953ad2d0b67fb9d.tar.xz
wireguard-openbsd-6278d0304dd1b39e46a509fa3953ad2d0b67fb9d.zip
merge 0.9.7d
Diffstat (limited to 'lib/libcrypto/mem.c')
-rw-r--r--lib/libcrypto/mem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libcrypto/mem.c b/lib/libcrypto/mem.c
index bb862db4997..dd86733b770 100644
--- a/lib/libcrypto/mem.c
+++ b/lib/libcrypto/mem.c
@@ -252,7 +252,7 @@ void *CRYPTO_malloc_locked(int num, const char *file, int line)
void *ret = NULL;
extern unsigned char cleanse_ctr;
- if (num < 0) return NULL;
+ if (num <= 0) return NULL;
allow_customize = 0;
if (malloc_debug_func != NULL)
@@ -293,7 +293,7 @@ void *CRYPTO_malloc(int num, const char *file, int line)
void *ret = NULL;
extern unsigned char cleanse_ctr;
- if (num < 0) return NULL;
+ if (num <= 0) return NULL;
allow_customize = 0;
if (malloc_debug_func != NULL)
@@ -324,7 +324,7 @@ void *CRYPTO_realloc(void *str, int num, const char *file, int line)
if (str == NULL)
return CRYPTO_malloc(num, file, line);
- if (num < 0) return NULL;
+ if (num <= 0) return NULL;
if (realloc_debug_func != NULL)
realloc_debug_func(str, NULL, num, file, line, 0);
@@ -346,7 +346,7 @@ void *CRYPTO_realloc_clean(void *str, int old_len, int num, const char *file,
if (str == NULL)
return CRYPTO_malloc(num, file, line);
- if (num < 0) return NULL;
+ if (num <= 0) return NULL;
if (realloc_debug_func != NULL)
realloc_debug_func(str, NULL, num, file, line, 0);