summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Heller <hellerda@us.ibm.com>2018-09-08 15:40:01 -0400
committerDave Heller <hellerda@us.ibm.com>2018-09-08 15:40:01 -0400
commitdecb6a75b902d8a5a53b3f64ca3f941d1d47d15c (patch)
tree8c8486dc4b61d9d7a4f38c69dc3a8e0c43a0a6ea
parent814a2ac0bbe6d34992832cdee38f82900997020d (diff)
downloadsb-signing-utils-decb6a75b902d8a5a53b3f64ca3f941d1d47d15c.tar.gz
sb-signing-utils-decb6a75b902d8a5a53b3f64ca3f941d1d47d15c.zip
Quash false positive code analyis warning in C code
Fix erroneous warning about scope of buf in print-container.c, by adding an unneeded but harmless init of its pointer in the surrounding scope. Signed-off-by: Dave Heller <hellerda@us.ibm.com>
-rw-r--r--print-container.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/print-container.c b/print-container.c
index 678b919..ad347a0 100644
--- a/print-container.c
+++ b/print-container.c
@@ -508,6 +508,10 @@ static bool getVerificationHash(char *input, unsigned char *md, int len)
char buf[len * 2 + 1 + 2]; // allow trailing \n and leading "0x"
char *p;
+ // Initializing makes it clear to source code analyzers that the scope of
+ // buf cannot be reduced; but p must be updated appropriately below.
+ p = (char *) buf;
+
if (isValidHex(input, len)) {
p = input;
} else {
OpenPOWER on IntegriCloud