aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-02 17:02:19 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-02 17:02:19 +0000
commit060c20e55d7dbbc156cb981b2778a1425b90cb06 (patch)
treea11a0ef7e24a6d05668ea747c707d4e82b757820 /mandocdb.c
parent5cdf519064e2a4e99ff35d500e68650cc82dfa4e (diff)
downloadmandoc-060c20e55d7dbbc156cb981b2778a1425b90cb06.tar.gz
mandoc-060c20e55d7dbbc156cb981b2778a1425b90cb06.tar.zst
mandoc-060c20e55d7dbbc156cb981b2778a1425b90cb06.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>.
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mandocdb.c b/mandocdb.c
index fc5cdb85..65c786ae 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.180 2014/12/30 20:41:00 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.181 2015/01/02 17:02:19 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -350,7 +350,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);
@@ -1106,6 +1107,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)