From fc897c641b5f26132b377c2d5df7ee18a0eedcd3 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Sun, 11 Jun 2023 07:24:00 +0200 Subject: [PATCH] fix a potential crash if a ngspice_probe.sym device is placed and live cursor annotation is enabled (this instance has no lab attribute) --- src/token.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/token.c b/src/token.c index 778d60e2..cbcc2361 100644 --- a/src/token.c +++ b/src/token.c @@ -3421,7 +3421,9 @@ const char *translate(int inst, const char* s) ++path; } prepare_netlist_structs(0); - my_strdup2(_ALLOC_ID_, &net, expandlabel(xctx->inst[inst].lab, &multip)); + if(xctx->inst[inst].lab) { + my_strdup2(_ALLOC_ID_, &net, expandlabel(xctx->inst[inst].lab, &multip)); + } if(net == NULL || net[0] == '\0') { my_strdup2(_ALLOC_ID_, &net, net_name(inst, 0, &multip, 0, 0)); }