summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-06-21 18:35:35 +0200
committerPaweł Redman <pawel.redman@gmail.com>2017-06-21 18:35:35 +0200
commit9fbadf8d0599ca1ce68bbb400a227d514b09d412 (patch)
treef24c0c4d0c74b9a158bda09b24995ac3a6433937 /src
parent85ecf73037f74bc798429a1a989e9a2ac6227ca7 (diff)
Fix an OOB access error in database code.HEADmaster
Diffstat (limited to 'src')
-rw-r--r--src/database.c2
1 files changed, 1 insertions, 1 deletions
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).