hsearch: fix null pointer arithmetic UB
authorSzabolcs Nagy <nsz@port70.net>
Fri, 3 Feb 2023 22:10:17 +0000 (23:10 +0100)
committerRich Felker <dalias@aerifal.cx>
Sun, 12 Feb 2023 22:41:23 +0000 (17:41 -0500)
commit7e6da7ac98efdc8167ed2d109298ba232a9a7ba3
tree776606dd8b1f51d743a4808b2ae89ee600ebd437
parentf79b973d92a322800b3e8411ccc95db280d997ae
hsearch: fix null pointer arithmetic UB

htab->__tab->entries pointer may be 0 so delay using it in arithmetics.
this did not cause any known issue other than with ubsan instrumentation.
src/search/hsearch.c