From: Geoff Thorpe <geoff@openssl.org> Date: Fri, 21 Nov 2003 21:42:35 +0000 (+0000) Subject: Fix a small bug in str_copy: if more than one variable is replaced, make X-Git-Tag: BEN_FIPS_TEST_4^2~11^2~13 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ec2179cf81687380eaef3c745e2dbbc15bbbe2cb;p=oweals%2Fopenssl.git Fix a small bug in str_copy: if more than one variable is replaced, make sure the current length is used to calculate the new buffer length instead of using the old length (prior to any variable substitution). Submitted by: Nils Larsch --- diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index 57d2739ae0..52a87aa76c 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -629,7 +629,7 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from) CONFerr(CONF_F_STR_COPY,CONF_R_VARIABLE_HAS_NO_VALUE); goto err; } - BUF_MEM_grow_clean(buf,(strlen(p)+len-(e-from))); + BUF_MEM_grow_clean(buf,(strlen(p)+buf->length-(e-from))); while (*p) buf->data[to++]= *(p++); from=e;