From 55e2f8aa5ed4f262fba6a7f1ccdfb2f2b4063fc6 Mon Sep 17 00:00:00 2001 From: mlarkin <> Date: Sat, 11 May 2024 02:18:20 +0000 Subject: A missing bounds check could lead to a crash due to dereferencing a zero-sized allocation. this is errata/7.5/003_libcrypto.patch.sig --- src/lib/libcrypto/lhash/lhash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/libcrypto/lhash/lhash.c b/src/lib/libcrypto/lhash/lhash.c index cd69f6fec1..a271934c76 100644 --- a/src/lib/libcrypto/lhash/lhash.c +++ b/src/lib/libcrypto/lhash/lhash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lhash.c,v 1.22 2024/03/02 11:11:11 tb Exp $ */ +/* $OpenBSD: lhash.c,v 1.22.2.1 2024/05/11 02:18:20 mlarkin Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -294,7 +294,9 @@ doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, /* Restore down load factor and trigger contraction. */ lh->down_load = down_load; - contract(lh); + if ((lh->num_nodes > MIN_NODES) && + (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) + contract(lh); } void -- cgit v1.2.3-55-g6feb