summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2016-10-12 15:51:44 +0000
committermillert <millert@openbsd.org>2016-10-12 15:51:44 +0000
commit8b53b4489e14ef2a0423dcb04b1fb49394f9a8d9 (patch)
tree28f49e657a1c921db255916c54ce067b0ee1fb27
parentFix a couple of problems with insert mode: flush dirty cells before we (diff)
downloadwireguard-openbsd-8b53b4489e14ef2a0423dcb04b1fb49394f9a8d9.tar.xz
wireguard-openbsd-8b53b4489e14ef2a0423dcb04b1fb49394f9a8d9.zip
When allocating the h_table array use the size of struct hash_head,
not the size of a pointer. From Joris Vink. OK fcambus@
-rw-r--r--usr.bin/cvs/hash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/cvs/hash.c b/usr.bin/cvs/hash.c
index 6abad73c438..0fe624be65b 100644
--- a/usr.bin/cvs/hash.c
+++ b/usr.bin/cvs/hash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hash.c,v 1.2 2015/01/16 06:40:07 deraadt Exp $ */
+/* $OpenBSD: hash.c,v 1.3 2016/10/12 15:51:44 millert Exp $ */
/*
* Copyright (c) 2008 Joris Vink <joris@openbsd.org>
*
@@ -44,7 +44,7 @@ hash_table_init(struct hash_table *htable, size_t hsize)
hsize = 1 << power;
}
- htable->h_table = xcalloc(hsize, sizeof(struct hash_head *));
+ htable->h_table = xcalloc(hsize, sizeof(struct hash_head));
htable->h_size = hsize;
for (i = 0; i < htable->h_size; i++)