From 2d4fb51ae614df454b2458263dc0c80892b11c71 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 26 Aug 2022 20:59:50 -0400 Subject: [PATCH] Corrected a failure to check for an invalid layer in the routine that queries a default layer width. Otherwise this can cause a segfault, especially when a technology file has not been specified and the minimum tech is in effect. --- drc/DRCtech.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drc/DRCtech.c b/drc/DRCtech.c index 13b7c603..74efbd27 100644 --- a/drc/DRCtech.c +++ b/drc/DRCtech.c @@ -4153,6 +4153,12 @@ DRCGetDefaultLayerWidth(ttype) DRCCookie *cptr; TileTypeBitMask *set; + if (ttype < 0) + { + TxError("Error: Attempt to get default width of invalid layer!\n"); + return 0; + } + for (cptr = DRCCurStyle->DRCRulesTbl[TT_SPACE][ttype]; cptr != (DRCCookie *) NULL; cptr = cptr->drcc_next) {