1 From 77d935b7ae7871a1940cd827e850e6063044ec45 Mon Sep 17 00:00:00 2001
2 From: Tobias Stoeckmann <tobias@stoeckmann.org>
3 Date: Mon, 4 May 2020 19:46:45 +0200
4 Subject: [PATCH 2/2] Prevent division by zero in linkhash.
6 If a linkhash with a size of zero is created, then modulo operations
7 are prone to division by zero operations.
9 Purely protective measure against bad usage.
12 1 file changed, 3 insertions(+)
24 @@ -498,6 +499,8 @@ struct lh_table* lh_table_new(int size,
28 + /* Allocate space for elements to avoid divisions by zero. */
30 t = (struct lh_table*)calloc(1, sizeof(struct lh_table));