summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/crypto/mem.c')
-rw-r--r--crypto/openssl/crypto/mem.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/openssl/crypto/mem.c b/crypto/openssl/crypto/mem.c
index 00ebaf0..05d7b9c 100644
--- a/crypto/openssl/crypto/mem.c
+++ b/crypto/openssl/crypto/mem.c
@@ -372,6 +372,10 @@ void *CRYPTO_realloc_clean(void *str, int old_len, int num, const char *file,
if (num <= 0) return NULL;
+ /* We don't support shrinking the buffer. Note the memcpy that copies
+ * |old_len| bytes to the new buffer, below. */
+ if (num < old_len) return NULL;
+
if (realloc_debug_func != NULL)
realloc_debug_func(str, NULL, num, file, line, 0);
ret=malloc_ex_func(num,file,line);
OpenPOWER on IntegriCloud