[PATCH] telemetry: reset data before passing it to callback

Bruce Richardson bruce.richardson at intel.com
Wed Feb 8 10:03:00 CET 2023


On Tue, Feb 07, 2023 at 07:45:20PM +0100, Robin Jarry wrote:
> If a telemetry endpoint callback returns 0 without modifying the data
> object, output_json() may be called with undefined contents in data.
> This can cause crashes and/or worse (double free, etc.).
> 
> Reset data before passing it to the endpoint callbacks.
> 
> Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Robin Jarry <rjarry at redhat.com>
> ---
>  lib/telemetry/telemetry.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
This is also fixed by patch http://patches.dpdk.org/project/dpdk/patch/20230120033456.29710-3-fengchengwen@huawei.com/

While both work the same way, I think I prefer the fix to set "= {0}" on
init rather than explicit memset.

/Bruce


More information about the dev mailing list