avoid computing 0 offsets from null pointers
authorAlexander Gallego <alex@vectorized.io>
Wed, 8 Jul 2020 15:21:45 +0000 (08:21 -0700)
committerAlexander Gallego <alex@vectorized.io>
Wed, 8 Jul 2020 15:30:07 +0000 (08:30 -0700)
commite68c7d38780ada518e6c43a09a2d92421ea8111b
treee6eef71097e78ffc37ed53a4ca689b27018f9603
parent49b3ad4bd41311e92fc3a18eda571800bde5aa42
avoid computing 0 offsets from null pointers

Similar work in the kernel:
https://patchwork.kernel.org/patch/11351499/

UBsan (+clang-10) complains about doing pointer arithmetic (adding 0)
to a nullpointer.

This patch is tested with clang-10+ubsan
lib/lz4.c