[PATCH 1/3] Don't call qsort() over NULL
Tim Wiederhake
twiederh at redhat.com
Mon Jun 14 11:31:44 UTC 2021
On Mon, 2021-06-14 at 13:06 +0200, Michal Privoznik wrote:
> In a few places it may happen that the array we want to sort is
> still NULL (e.g. because there were no leases found, no paths for
> secdriver to lock or no cache banks). However, passing NULL to
> qsort() is undefined and even though glibc plays nicely we
> shouldn't rely on undefined behaviour.
>
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
Reviewed-by: Tim Wiederhake <twiederh at redhat.com>
More information about the libvir-list
mailing list