From bd9c2e4840d14a7bb8b04c9c1239f9b9f662b066 Mon Sep 17 00:00:00 2001 From: schwarze Date: Fri, 2 Jan 2015 17:01:31 +0000 Subject: [PATCH] =?utf8?q?Explicitly=20set=20the=20*data=20member=20of=20s?= =?utf8?q?truct=20ohash=5Finfo=20to=20NULL.=20It=20is=20never=20dereferenc?= =?utf8?q?ed,=20but=20it=20gets=20copied=20around,=20which=20worries=20sta?= =?utf8?q?tic=20analysis=20tools=20and=20might=20also=20confuse=20human=20?= =?utf8?q?auditors.=20FreeBSD=20Coverity=20CID=201261298,=201261299,=20126?= =?utf8?q?1300,=20reported=20by=20Pedro=20Giffuni=20and=20Ulrich=20Sp?= =?utf8?q?=C3=B6rlein=20.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- usr.bin/mandoc/mandocdb.c | 6 ++++-- 1 file 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 * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze @@ -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) -- 2.20.1