mirror of
https://github.com/openssl/openssl.git
synced 2025-01-30 14:01:55 +08:00
Fix crash in BUF_MEM_grow_clean.
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/3896)
This commit is contained in:
parent
c7c7a8e601
commit
e1ca9e1f6d
@ -62,9 +62,11 @@ static char *sec_alloc_realloc(BUF_MEM *str, size_t len)
|
||||
|
||||
ret = OPENSSL_secure_malloc(len);
|
||||
if (str->data != NULL) {
|
||||
if (ret != NULL)
|
||||
if (ret != NULL) {
|
||||
memcpy(ret, str->data, str->length);
|
||||
OPENSSL_secure_free(str->data);
|
||||
OPENSSL_secure_free(str->data);
|
||||
str->data = NULL;
|
||||
}
|
||||
}
|
||||
return (ret);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user