keep len correct when substituting variables - fixes PR/24458

This commit is contained in:
kardel 2006-10-08 22:21:14 +00:00
parent af0dfc77d5
commit f34e7857d3
1 changed files with 2 additions and 1 deletions

View File

@ -629,7 +629,8 @@ 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)+buf->length-(e-from)));
len = strlen(p)+len-(e-from);
BUF_MEM_grow_clean(buf, len);
while (*p)
buf->data[to++]= *(p++);