From bbe447423b6c313d1ff4c652c9c7721b2ad1b324 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Fri, 4 Oct 2024 20:17:05 +0100 Subject: [PATCH] gaStem.c: type, The left operand of '==' is a garbage value Theoretical use of unintialized data. Added 'default' case into switch to throw ASSERT(), otherwise when assertions disabled treat consistently as GEO_NORTH. SonarCloud The left operand of '==' is a garbage value https://sonarcloud.io/project/issues?open=AZJB17fSNGfDNup0Rkoh&id=dlmiles_magic --- garouter/gaStem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/garouter/gaStem.c b/garouter/gaStem.c index cd58da3d..6476dc85 100644 --- a/garouter/gaStem.c +++ b/garouter/gaStem.c @@ -802,6 +802,9 @@ gaStemNetClear(termArea, point, side, netList) */ switch (side) { + default: + ASSERT(FALSE, "side"); + /* fall-thru */ case GEO_NORTH: r.r_xbot = point->p_x - RtrSubcellSepUp; r.r_xtop = point->p_x + RtrSubcellSepDown;