diff options
author | Bodo Möller <bodo@openssl.org> | 2001-10-26 13:12:25 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2001-10-26 13:12:25 +0000 |
commit | b693f941fdf19e9006c141d5351d707ebbd89522 (patch) | |
tree | 2e85b588c03a105d7f78fcfaa91dafc1968a52e7 /crypto/buffer | |
parent | c602e7f4e8a1fd95b1e57b2183646db7126a5335 (diff) |
Consistency fix in BUF_MEM_grow: Initialise to zero when new memory
had to be allocated, not just when reusing the existing buffer.
Diffstat (limited to 'crypto/buffer')
-rw-r--r-- | crypto/buffer/buffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/buffer/buffer.c b/crypto/buffer/buffer.c index b76ff3ad7a..9299baba9e 100644 --- a/crypto/buffer/buffer.c +++ b/crypto/buffer/buffer.c @@ -118,8 +118,9 @@ int BUF_MEM_grow(BUF_MEM *str, int len) else { str->data=ret; - str->length=len; str->max=n; + memset(&str->data[str->length],0,len-str->length); + str->length=len; } return(len); } |