mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
memset() doesn't take NULL.
Reviewed-by: Emilia Käsper <emilia@openssl.org>
This commit is contained in:
parent
c38bb72797
commit
5cf14ce074
@ -128,7 +128,8 @@ size_t BUF_MEM_grow(BUF_MEM *str, size_t len)
|
|||||||
return (len);
|
return (len);
|
||||||
}
|
}
|
||||||
if (str->max >= 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;
|
str->length = len;
|
||||||
return (len);
|
return (len);
|
||||||
}
|
}
|
||||||
@ -160,7 +161,8 @@ size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
|
|||||||
size_t n;
|
size_t n;
|
||||||
|
|
||||||
if (str->length >= len) {
|
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;
|
str->length = len;
|
||||||
return (len);
|
return (len);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user