All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH qemu] ppc/vof: Fix uninitialized string tracing
@ 2022-04-06  4:50 Alexey Kardashevskiy
  2022-04-06 14:51 ` Daniel Henrique Barboza
  2022-04-20 19:16 ` Daniel Henrique Barboza
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Kardashevskiy @ 2022-04-06  4:50 UTC (permalink / raw)
  To: qemu-ppc; +Cc: Alexey Kardashevskiy, Peter Maydell, qemu-devel

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>
---
 hw/ppc/vof.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ppc/vof.c b/hw/ppc/vof.c
index 2b63a6287561..5ce3ca32c998 100644
--- a/hw/ppc/vof.c
+++ b/hw/ppc/vof.c
@@ -294,7 +294,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] = "";
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH qemu] ppc/vof: Fix uninitialized string tracing
  2022-04-06  4:50 [PATCH qemu] ppc/vof: Fix uninitialized string tracing Alexey Kardashevskiy
@ 2022-04-06 14:51 ` Daniel Henrique Barboza
  2022-04-20 19:16 ` Daniel Henrique Barboza
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Henrique Barboza @ 2022-04-06 14:51 UTC (permalink / raw)
  To: Alexey Kardashevskiy, qemu-ppc; +Cc: Peter Maydell, qemu-devel



On 4/6/22 01:50, Alexey Kardashevskiy wrote:
> 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>

>   hw/ppc/vof.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/vof.c b/hw/ppc/vof.c
> index 2b63a6287561..5ce3ca32c998 100644
> --- a/hw/ppc/vof.c
> +++ b/hw/ppc/vof.c
> @@ -294,7 +294,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] = "";


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH qemu] ppc/vof: Fix uninitialized string tracing
  2022-04-06  4:50 [PATCH qemu] ppc/vof: Fix uninitialized string tracing Alexey Kardashevskiy
  2022-04-06 14:51 ` Daniel Henrique Barboza
@ 2022-04-20 19:16 ` Daniel Henrique Barboza
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Henrique Barboza @ 2022-04-20 19:16 UTC (permalink / raw)
  To: Alexey Kardashevskiy, qemu-ppc; +Cc: Peter Maydell, qemu-devel

Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks,


Daniel

On 4/6/22 01:50, Alexey Kardashevskiy wrote:
> 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>
> ---
>   hw/ppc/vof.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/vof.c b/hw/ppc/vof.c
> index 2b63a6287561..5ce3ca32c998 100644
> --- a/hw/ppc/vof.c
> +++ b/hw/ppc/vof.c
> @@ -294,7 +294,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] = "";


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-20 19:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06  4:50 [PATCH qemu] ppc/vof: Fix uninitialized string tracing Alexey Kardashevskiy
2022-04-06 14:51 ` Daniel Henrique Barboza
2022-04-20 19:16 ` Daniel Henrique Barboza

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.