From 44bb9327a2b666feab3edc36632bed668aab0de9 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Wed, 26 Feb 2025 06:27:44 +0000 Subject: [PATCH] ExtTech.c: fix uninitialized exts_linearResist value leaks into extresist This value appears to be initialised at only one spot in the codebase (under very narrow conditions) but extresist will read it and make branching decisions based on the uninitialised state. This 'X' state propagation appears to eventually get processed in ResWriteExtFile() near where final output formatting is occurring. It is unclear (at this time) if it perturbs output values in a problematic way, or if due to algorithmic reasons the data is discarded before output anyway. I have at least one trace run (with multiple triggers) of printf formatters handling uninitialised data in ResWriteExtFile(). --- extract/ExtTech.c | 1 + 1 file changed, 1 insertion(+) diff --git a/extract/ExtTech.c b/extract/ExtTech.c index 5071f128..af374abc 100644 --- a/extract/ExtTech.c +++ b/extract/ExtTech.c @@ -2807,6 +2807,7 @@ ExtTechLine(sectionName, argc, argv) } devptr->exts_deviceResist.ht_table = (HashEntry **) NULL; HashInit(&devptr->exts_deviceResist, 8, HT_STRINGKEYS); + devptr->exts_linearResist = 0; devptr->exts_next = ExtCurStyle->exts_device[t]; ExtCurStyle->exts_device[t] = devptr;