diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2012-06-27 16:44:58 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2012-06-27 16:44:58 +0000 |
commit | 2b8b5455829304396e38200c205612c4dc57c052 (patch) | |
tree | cc5cd6657453d80b7eafb3ba5cc4ef4fd66c176f /crypto/mem.c | |
parent | fd3744ddb062b70bb370acec340acbac23f0bd98 (diff) |
Diffstat (limited to 'crypto/mem.c')
-rw-r--r-- | crypto/mem.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/mem.c b/crypto/mem.c index 00ebaf0b9b5e3..05d7b9cd3d7aa 100644 --- a/crypto/mem.c +++ b/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); |