From f0159cbd0b640555b350b7fb218c0a1510abaf78 Mon Sep 17 00:00:00 2001 From: rlar Date: Mon, 13 Nov 2017 20:36:49 +0100 Subject: [PATCH] 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 76feebbbfad30a449a182367a9aa2d732c6cd587 > Date: Thu Feb 25 21:43:03 2010 +0000 > various bug fixes --- src/frontend/numparam/spicenum.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/frontend/numparam/spicenum.c b/src/frontend/numparam/spicenum.c index 876f423e1..b6879ab79 100644 --- a/src/frontend/numparam/spicenum.c +++ b/src/frontend/numparam/spicenum.c @@ -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);