From 2b88d79adc3aa59f9bdd33c276303fbfdac777fa Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 16 Aug 2024 19:48:36 -0400 Subject: [PATCH] Corrected a rare case where a NULL value propagates in the flattening routine and is not caught until it causes a segfault. --- VERSION | 2 +- base/flatten.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index b6bd287..c6531a7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.276 +1.5.277 diff --git a/base/flatten.c b/base/flatten.c index 78596e4..f9840b7 100644 --- a/base/flatten.c +++ b/base/flatten.c @@ -600,8 +600,10 @@ int flattenInstancesOf(char *name, int fnum, char *instance) else break; /* Put the child cell at the start of ChildObjList */ - ChildEnd->next = ChildObjList; - ChildObjList = ChildStart; + if (ChildEnd) { + ChildEnd->next = ChildObjList; + ChildObjList = ChildStart; + } } /* Put the child cell at the start of ChildObjList */