From ff08df0eed7c6c6d76f451fd1edf1ab780751fa5 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 5 Oct 2021 13:25:39 -0400 Subject: [PATCH] Fix to new ext2spice code to prevent a crash condition when multiple instances of a port name are present. --- ext2spice/ext2spice.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext2spice/ext2spice.c b/ext2spice/ext2spice.c index 57e97c5b..b7dd1fce 100644 --- a/ext2spice/ext2spice.c +++ b/ext2spice/ext2spice.c @@ -1821,7 +1821,8 @@ topVisit(def, doStub) { hep = HashFind(&portNameTable, pname); HashSetValue(hep, (ClientData)(pointertype)nodeName->efnn_port); - sorted_ports[portidx] = StrDup((char **)NULL, pname); + if (sorted_ports[portidx] == NULL) + sorted_ports[portidx] = StrDup((char **)NULL, pname); } else {