From: Bodo Möller Date: Fri, 26 Oct 2001 13:12:25 +0000 (+0000) Subject: Consistency fix in BUF_MEM_grow: Initialise to zero when new memory X-Git-Tag: OpenSSL_0_9_6c~26^2~80 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=b693f941fdf19e9006c141d5351d707ebbd89522;ds=sidebyside Consistency fix in BUF_MEM_grow: Initialise to zero when new memory had to be allocated, not just when reusing the existing buffer. --- 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); }