提交 e1ca9e1f 编写于 作者: B Bernd Edlinger

Fix crash in BUF_MEM_grow_clean.

Reviewed-by: NTim Hudson <tjh@openssl.org>
Reviewed-by: NBen Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/3896)
上级 c7c7a8e6
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册