Another correction to a code error from a commit earlier today.

Fixes an infinite loop when querying properties during CIF read.
This commit is contained in:
R. Timothy Edwards 2026-02-18 20:27:33 -05:00
parent 2f00f6d8f1
commit 0c913eca59
1 changed files with 4 additions and 2 deletions

View File

@ -790,7 +790,7 @@ CIFPaintCurrent(
for (i = 0; i < cifNReadLayers; i++) for (i = 0; i < cifNReadLayers; i++)
{ {
LinkedRect *lrec = NULL; LinkedRect *lrec = NULL, *lsrch;
char *propstr = NULL; char *propstr = NULL;
char locstr[512]; char locstr[512];
Plane *tempp; Plane *tempp;
@ -835,7 +835,9 @@ CIFPaintCurrent(
* target cell. * target cell.
*/ */
proplen = 0; proplen = 0;
while (lrec != NULL) proplen += 4; for (lsrch = lrec; lsrch; lsrch = lsrch->r_next)
proplen += 4;
proprec = (PropertyRecord *)mallocMagic(sizeof(PropertyRecord) * proprec = (PropertyRecord *)mallocMagic(sizeof(PropertyRecord) *
(proplen - 2) * sizeof(int)); (proplen - 2) * sizeof(int));
proprec->prop_type = PROPERTY_TYPE_DIMENSION; proprec->prop_type = PROPERTY_TYPE_DIMENSION;