]> git.ipfire.org Git - thirdparty/kmod.git/commit
shared: avoid passing {NULL, 0} array to bsearch()
authorDmitry Antipov <dmantipov@yandex.ru>
Fri, 19 May 2023 07:41:08 +0000 (10:41 +0300)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Wed, 31 May 2023 05:36:43 +0000 (22:36 -0700)
commit9c262fdb1c798fd87d91e8c669acbec4d632024b
tree8de70b43fb1e292194c96aa9eaf2733c56055e6f
parentbadacf76e46b3602bc0e99ffc677ccbe53691f62
shared: avoid passing {NULL, 0} array to bsearch()

Fix the following warning reported by UBSan (as of gcc-13.1.1):

shared/hash.c:244:35: runtime error: null pointer passed as
argument 2, which is declared to never be null

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
[ reshuffle the code to use return-early style ]
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
shared/hash.c