]> git.ipfire.org Git - thirdparty/kmod.git/commit
Avoid adding zero to a NULL pointer
authorEmil Velikov <emil.l.velikov@gmail.com>
Wed, 9 Oct 2024 15:26:25 +0000 (16:26 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 17 Oct 2024 13:28:08 +0000 (08:28 -0500)
commit944d970f0fa9e024810fc395f45a33c8e02dd6e6
tree94b31936a6ae5fff19e729cec86e4c42be07bcda
parent4bfcece0df091d08e10a20ba34775d718bd32ab0
Avoid adding zero to a NULL pointer

Adding zero to a NULL pointer is undefined behaviour, which is getting
clarified with C23 (or just after) to match our current usage.

With clang 18, this triggers the undefined behaviour sanitizer so add a
check to stay compliant.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/180
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
shared/array.c
shared/hash.c
tools/depmod.c