提交 5cf14ce0 编写于 作者: B Ben Laurie

memset() doesn't take NULL.

Reviewed-by: NEmilia Käsper <emilia@openssl.org>
上级 c38bb727
......@@ -128,7 +128,8 @@ size_t BUF_MEM_grow(BUF_MEM *str, size_t len)
return (len);
}
if (str->max >= len) {
memset(&str->data[str->length], 0, len - str->length);
if (str->data != NULL)
memset(&str->data[str->length], 0, len - str->length);
str->length = len;
return (len);
}
......@@ -160,7 +161,8 @@ size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
size_t n;
if (str->length >= len) {
memset(&str->data[len], 0, str->length - len);
if (str->data != NULL)
memset(&str->data[len], 0, str->length - len);
str->length = len;
return (len);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册