[PATCH v5 13/22] graph: fix stats query with no node xstats
fengchengwen
fengchengwen at huawei.com
Wed Aug 13 04:10:34 CEST 2025
Acked-by: Chengwen Feng <fengchengwen at huawei.com>
On 7/23/2025 9:31 PM, David Marchand wrote:
> From: Marat Khalili <marat.khalili at huawei.com>
>
> This was flagged by undefined behaviour sanitizer: memset should not be
> called with NULL first argument. (memset requires first argument to be
> pointer to a memory object, so passing NULL may result in an undefined
> behaviour including among other things optimizer potentially removing
> code paths depending on stat->xstat_count being NULL.)
>
> Sanitizer message:
>
> lib/graph/graph_stats.c:473:2: runtime error: null pointer passed as
> argument 1, which is declared to never be null
>
> Add a check that stat->xstat_cntrs is not zero before the call, since
> stat->xstat_count can only be NULL when stat->xstat_cntrs is zero.
>
> Fixes: 070db97e017b ("graph: support node xstats")
> Cc: stable at dpdk.org
>
> Signed-off-by: Marat Khalili <marat.khalili at huawei.com>
More information about the dev
mailing list