From 48853b98a3b346043144e79a6173b1a2492eca3d Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Sun, 29 Sep 2024 23:00:00 +0100 Subject: [PATCH] calma/CalmaRead.c missing initialization An FEOF exit path exists in READRH() which causes the output variable(s) to not be assigned a value, then the code makes a decision (branch) based on uninitialized data. SonarCloud detection CalmaRead.c:359:The left operand of '!=' is a garbage value https://sonarcloud.io/project/issues?open=AZJB17gSNGfDNup0Rkp5&id=dlmiles_magic --- calma/CalmaRead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calma/CalmaRead.c b/calma/CalmaRead.c index d8db3fdf..08b0c0b6 100644 --- a/calma/CalmaRead.c +++ b/calma/CalmaRead.c @@ -345,7 +345,7 @@ done: bool calmaParseUnits() { - int nbytes, rtype; + int nbytes, rtype = 0; double metersPerDBUnit; double userUnitsPerDBUnit; double cuPerDBUnit;