numparam/spicenum.c, stripbraces(), bug fix

overwriting SPICE_DSTRING `dstr_p' may invalidate `s'

This bug was injected with the introduction of SPICE_DSTRING in :
> commit 76feebbbfa
> Date:   Thu Feb 25 21:43:03 2010 +0000
>     various bug fixes
This commit is contained in:
rlar 2017-11-13 20:36:49 +01:00
parent 84761c125f
commit f0159cbd0b
1 changed files with 1 additions and 2 deletions

View File

@ -149,8 +149,7 @@ stripbraces(SPICE_DSTRINGPTR dstr_p)
cadd(&tstr, ' ');
i = spice_dstring_length(&tstr);
pscopy(dstr_p, s, j, ls);
sadd(&tstr, s);
sadd(&tstr, s + j);
scopyd(dstr_p, &tstr);
s = spice_dstring_value(dstr_p);
ls = spice_dstring_length(dstr_p);