From ca9229b35a9194fd23c8435e4791e79b7feae422 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Thu, 13 Feb 2025 08:22:28 +0000 Subject: [PATCH] CodeQL MissingNegativtyTest.ql ttype>=0 ResSimSubckt() This variable is used as array index, but the extGetDevType() API allows a negative return to occur. --- resis/ResReadSim.c | 1 + 1 file changed, 1 insertion(+) diff --git a/resis/ResReadSim.c b/resis/ResReadSim.c index da55e54b..0320c3a9 100644 --- a/resis/ResReadSim.c +++ b/resis/ResReadSim.c @@ -426,6 +426,7 @@ ResSimSubckt(line) return 1; } ttype = extGetDevType(EFDevTypes[j]); + ASSERT(ttype >= 0, "ttype<0"); /* Find the device record that corresponds to the device name */ for (devptr = ExtCurStyle->exts_device[ttype]; devptr; devptr = devptr->exts_next)