diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-02 17:02:19 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-02 17:02:19 +0000 |
commit | 5060daf78ef5efd8d0a39be9479697abc74befe0 (patch) | |
tree | ddee4feba81dbcee9fd68984e22c739a41faaea4 /mandocdb.c | |
parent | c147a10e9238c3d84c374dadb602444272da1d10 (diff) | |
download | mandoc-5060daf78ef5efd8d0a39be9479697abc74befe0.tar.gz |
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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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) |