]> git.ipfire.org Git - thirdparty/kmod.git/commit
depmod: Prevent undefined behavior
authorTobias Stoeckmann <tobias@stoeckmann.org>
Fri, 18 Oct 2024 15:37:40 +0000 (17:37 +0200)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 22 Oct 2024 16:52:48 +0000 (11:52 -0500)
commitd056ac221b2b944307b561bbfc35e5fb3f782e1d
tree81b9178725beafe10ed9d44e0826103a0ab026b7
parent10c8bb097622f434274bdef4aeb54a77d3176aab
depmod: Prevent undefined behavior

Calling qsort with NULL argument is invalid, although size 0 would
prevent anything bad from happening. Make sure that UBSAN is not
triggered.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/193
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
tools/depmod.c