Browse Source

Rename *_realloc_clean to *_clear_realloc

Just like *_clear_free routines.  Previously undocumented, used
a half-dozen times within OpenSSL source.

Reviewed-by: Richard Levitte <levitte@openssl.org>
master
Rich Salz 7 years ago
committed by Rich Salz
parent
commit
c99de0533d
6 changed files with 8 additions and 8 deletions
  1. +1
    -1
      crypto/asn1/a_bitstr.c
  2. +1
    -1
      crypto/asn1/f_int.c
  3. +1
    -1
      crypto/buffer/buffer.c
  4. +1
    -1
      crypto/mem.c
  5. +3
    -3
      include/openssl/crypto.h
  6. +1
    -1
      util/libeay.num

+ 1
- 1
crypto/asn1/a_bitstr.c View File

@ -204,7 +204,7 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
if ((a->length < (w + 1)) || (a->data == NULL)) {
if (!value)
return (1); /* Don't need to set */
c = OPENSSL_realloc_clean(a->data, a->length, w + 1);
c = OPENSSL_clear_realloc(a->data, a->length, w + 1);
if (c == NULL) {
ASN1err(ASN1_F_ASN1_BIT_STRING_SET_BIT, ERR_R_MALLOC_FAILURE);
return 0;


+ 1
- 1
crypto/asn1/f_int.c View File

@ -164,7 +164,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size)
}
i /= 2;
if (num + i > slen) {
sp = OPENSSL_realloc_clean(s, slen, num + i * 2);
sp = OPENSSL_clear_realloc(s, slen, num + i * 2);
if (sp == NULL) {
ASN1err(ASN1_F_A2I_ASN1_INTEGER, ERR_R_MALLOC_FAILURE);
OPENSSL_free(s);


+ 1
- 1
crypto/buffer/buffer.c View File

@ -179,7 +179,7 @@ size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
if ((str->flags & BUF_MEM_FLAG_SECURE))
ret = sec_alloc_realloc(str, n);
else
ret = OPENSSL_realloc_clean(str->data, str->max, n);
ret = OPENSSL_clear_realloc(str->data, str->max, n);
if (ret == NULL) {
BUFerr(BUF_F_BUF_MEM_GROW_CLEAN, ERR_R_MALLOC_FAILURE);
len = 0;


+ 1
- 1
crypto/mem.c View File

@ -337,7 +337,7 @@ void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
return ret;
}
void *CRYPTO_realloc_clean(void *str, size_t old_len, size_t num,
void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num,
const char *file, int line)
{
void *ret = NULL;


+ 3
- 3
include/openssl/crypto.h View File

@ -326,8 +326,8 @@ int CRYPTO_is_mem_check_on(void);
# define OPENSSL_strndup(str, s) CRYPTO_strndup((str), (s), __FILE__, __LINE__)
# define OPENSSL_realloc(addr,num) \
CRYPTO_realloc((char *)addr, (int)num, __FILE__, __LINE__)
# define OPENSSL_realloc_clean(addr,old_num,num) \
CRYPTO_realloc_clean(addr, old_num, num, __FILE__, __LINE__)
# define OPENSSL_clear_realloc(addr, old_num, num) \
CRYPTO_clear_realloc(addr, old_num, num, __FILE__, __LINE__)
# define OPENSSL_clear_free(addr, num) CRYPTO_clear_free(addr, num)
# define OPENSSL_free(addr) CRYPTO_free(addr)
@ -480,7 +480,7 @@ char *CRYPTO_strndup(const char *str, size_t s, const char *file, int line);
void CRYPTO_free(void *ptr);
void CRYPTO_clear_free(void *ptr, size_t num);
void *CRYPTO_realloc(void *addr, size_t num, const char *file, int line);
void *CRYPTO_realloc_clean(void *addr, size_t old_num, size_t num,
void *CRYPTO_clear_realloc(void *addr, size_t old_num, size_t num,
const char *file, int line);
# define OPENSSL_secure_malloc(num) \


+ 1
- 1
util/libeay.num View File

@ -2797,7 +2797,7 @@ EVP_des_ede3_ecb 3236 1_1_0 EXIST::FUNCTION:DES
X509_REQ_print_ex 3237 1_1_0 EXIST::FUNCTION:
ENGINE_up_ref 3238 1_1_0 EXIST::FUNCTION:ENGINE
BUF_MEM_grow_clean 3239 1_1_0 EXIST::FUNCTION:
CRYPTO_realloc_clean 3240 1_1_0 EXIST::FUNCTION:
CRYPTO_clear_realloc 3240 1_1_0 EXIST::FUNCTION:
BUF_strlcat 3241 1_1_0 NOEXIST::FUNCTION:
BIO_indent 3242 1_1_0 EXIST::FUNCTION:
BUF_strlcpy 3243 1_1_0 NOEXIST::FUNCTION:


Loading…
Cancel
Save