]> git.proxmox.com Git - mirror_qemu.git/commitdiff
ppc/vof: Fix uninitialized string tracing
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Wed, 6 Apr 2022 04:50:13 +0000 (14:50 +1000)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Wed, 20 Apr 2022 21:00:30 +0000 (18:00 -0300)
There are error paths which do not initialize propname but the trace_exit
label prints it anyway. This initializes the problem string.

Spotted by Coverity CID 1487241.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220406045013.3610172-1-aik@ozlabs.ru>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
hw/ppc/vof.c

index 8d96593677da981ac5a46ddf7d046768c790d83b..18c3f92317a4f3e8992bcef60a0bd9d55fa4cae1 100644 (file)
@@ -293,7 +293,7 @@ static uint32_t vof_setprop(MachineState *ms, void *fdt, Vof *vof,
                             uint32_t nodeph, uint32_t pname,
                             uint32_t valaddr, uint32_t vallen)
 {
-    char propname[OF_PROPNAME_LEN_MAX + 1];
+    char propname[OF_PROPNAME_LEN_MAX + 1] = "";
     uint32_t ret = PROM_ERROR;
     int offset, rc;
     char trval[64] = "";