Re: [PATCH v2] bpftool: Fix undefined behavior in qsort(NULL, 0, ...)

From: patchwork-bot+netdevbpf
Date: Tue Sep 10 2024 - 14:50:49 EST


Hello:

This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@xxxxxxxxxx>:

On Tue, 10 Sep 2024 23:02:07 +0800 you wrote:
> When netfilter has no entry to display, qsort is called with
> qsort(NULL, 0, ...). This results in undefined behavior, as UBSan
> reports:
>
> net.c:827:2: runtime error: null pointer passed as argument 1, which is declared to never be null
>
> Although the C standard does not explicitly state whether calling qsort
> with a NULL pointer when the size is 0 constitutes undefined behavior,
> Section 7.1.4 of the C standard (Use of library functions) mentions:
>
> [...]

Here is the summary with links:
- [v2] bpftool: Fix undefined behavior in qsort(NULL, 0, ...)
https://git.kernel.org/bpf/bpf-next/c/f04e2ad394e2

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html