Guard call to contract() from doall_util_fn().
authorjsing <jsing@openbsd.org>
Mon, 6 May 2024 14:36:05 +0000 (14:36 +0000)
committerjsing <jsing@openbsd.org>
Mon, 6 May 2024 14:36:05 +0000 (14:36 +0000)
commit7b25026418e082ff146b25c2dd1082fe79f780f9
tree7491ec9fb80293be707044893cc36b1b63f28777
parent58a6500f54a1c08f5c0277139d1f73ebc29a5463
Guard call to contract() from doall_util_fn().

It is not safe to unconditionally call contract() - when called repeatedly
it will shrink the bucket array to zero and then attempt to access that
allocation on the next call. Use the same guard that is used in
lh_delete().

Issue found when investigating haproxy crashes reported by wizard-it on
GitHub.

ok tb@
lib/libcrypto/lhash/lhash.c