summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2015-01-02 17:01:31 +0000
committerschwarze <schwarze@openbsd.org>2015-01-02 17:01:31 +0000
commitbd9c2e4840d14a7bb8b04c9c1239f9b9f662b066 (patch)
tree25ad905c84efcf7fda23041c0267babca496e101
parentRename the tls_connect_socket() parameter 'socket' to 's' to avoid (diff)
downloadwireguard-openbsd-bd9c2e4840d14a7bb8b04c9c1239f9b9f662b066.tar.xz
wireguard-openbsd-bd9c2e4840d14a7bb8b04c9c1239f9b9f662b066.zip
Explicitly set the *data member of struct ohash_info to NULL.
It is never dereferenced, but it gets copied around, which worries static analysis tools and might also confuse human auditors. FreeBSD Coverity CID 1261298, 1261299, 1261300, reported by Pedro Giffuni and Ulrich Spörlein <pfg@ and uqs@ at FreeBSD>.
-rw-r--r--usr.bin/mandoc/mandocdb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mandocdb.c b/usr.bin/mandoc/mandocdb.c
index 0ffbd15b602..544e1ffe110 100644
--- a/usr.bin/mandoc/mandocdb.c
+++ b/usr.bin/mandoc/mandocdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mandocdb.c,v 1.134 2014/12/30 20:40:05 schwarze Exp $ */
+/* $OpenBSD: mandocdb.c,v 1.135 2015/01/02 17:01:31 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -340,7 +340,8 @@ mandocdb(int argc, char *argv[])
mpages_info.alloc = mlinks_info.alloc = hash_alloc;
mpages_info.calloc = mlinks_info.calloc = hash_calloc;
- mpages_info.free = mlinks_info.free = hash_free;
+ mpages_info.free = mlinks_info.free = hash_free;
+ mpages_info.data = mlinks_info.data = NULL;
mpages_info.key_offset = offsetof(struct mpage, inodev);
mlinks_info.key_offset = offsetof(struct mlink, file);
@@ -1096,6 +1097,7 @@ mpages_merge(struct mparse *mp)
str_info.alloc = hash_alloc;
str_info.calloc = hash_calloc;
str_info.free = hash_free;
+ str_info.data = NULL;
str_info.key_offset = offsetof(struct str, key);
if ( ! nodb)