From 9fbadf8d0599ca1ce68bbb400a227d514b09d412 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Wed, 21 Jun 2017 18:35:35 +0200 Subject: Fix an OOB access error in database code. --- src/database.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/database.c b/src/database.c index b3ffb7f..373ce62 100644 --- a/src/database.c +++ b/src/database.c @@ -26,7 +26,7 @@ static size_t db_hash(uint32_t ipv4) return (((ipv4 >> 16) ^ ipv4) * 3137) & HASH_MAX; } -db_entry *database[HASH_MAX]; +db_entry *database[HASH_MAX + 1]; pthread_mutex_t database_mutex = PTHREAD_MUTEX_INITIALIZER; // Returns a pointer to the relevant db_entry (newly created if didn't exist). -- cgit