From 0c913eca59fcfc23e5adc0980dfd1668fcbda4d1 Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Wed, 18 Feb 2026 20:27:33 -0500 Subject: [PATCH] Another correction to a code error from a commit earlier today. Fixes an infinite loop when querying properties during CIF read. --- cif/CIFrdcl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cif/CIFrdcl.c b/cif/CIFrdcl.c index 71f3f99a..799ec1d0 100644 --- a/cif/CIFrdcl.c +++ b/cif/CIFrdcl.c @@ -790,7 +790,7 @@ CIFPaintCurrent( for (i = 0; i < cifNReadLayers; i++) { - LinkedRect *lrec = NULL; + LinkedRect *lrec = NULL, *lsrch; char *propstr = NULL; char locstr[512]; Plane *tempp; @@ -835,7 +835,9 @@ CIFPaintCurrent( * target cell. */ proplen = 0; - while (lrec != NULL) proplen += 4; + for (lsrch = lrec; lsrch; lsrch = lsrch->r_next) + proplen += 4; + proprec = (PropertyRecord *)mallocMagic(sizeof(PropertyRecord) * (proplen - 2) * sizeof(int)); proprec->prop_type = PROPERTY_TYPE_DIMENSION;