From 0b92a15ae8ab844489e2f8bca59422a9f06b227e Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sat, 13 Jul 2019 17:43:57 +0200 Subject: [PATCH] safeguard against vectors with 0 length --- src/sharedspice.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sharedspice.c b/src/sharedspice.c index 6b7099b69..8cb6e72fa 100644 --- a/src/sharedspice.c +++ b/src/sharedspice.c @@ -1860,6 +1860,9 @@ int sh_ExecutePerLoop(void) /* get the data of the last entry to the plot vector */ veclen = pl->pl_dvecs->v_length - 1; + /* safeguard against vectors with 0 length (e.g. @c1[i] during ac simulation) */ + if (veclen < 1) + return 2; curvecvalsall->vecindex = veclen; for (d = pl->pl_dvecs, i = 0; d; d = d->v_next, i++) { /* test if real */