INN commit: trunk/storage/tradindexed (tdx-group.c)
INN Commit
Russ_Allbery at isc.org
Sun Dec 14 04:50:34 UTC 2008
Date: Saturday, December 13, 2008 @ 20:50:33
Author: eagle
Revision: 8221
hashmap_load() can return NULL in weird cases (missing active file),
so check the return value before using it when doing audits. Found
by Saturn back in 2007.
Modified:
trunk/storage/tradindexed/tdx-group.c
-------------+
tdx-group.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Modified: tdx-group.c
===================================================================
--- tdx-group.c 2008-12-14 04:28:15 UTC (rev 8220)
+++ tdx-group.c 2008-12-14 04:50:33 UTC (rev 8221)
@@ -1410,6 +1410,10 @@
need to map hashes to group names, so load a hash of the active file to
do that resolution. */
hashmap = hashmap_load();
+ if (hashmap == NULL) {
+ warn("tradindexed: cannot hash active file");
+ return;
+ }
data.index = index;
data.fix = fix;
hash_traverse(hashmap, index_audit_active, &data);
@@ -1419,6 +1423,5 @@
continue;
index_audit_group(index, entry, hashmap, fix);
}
- if (hashmap != NULL)
- hash_free(hashmap);
+ hash_free(hashmap);
}
More information about the inn-committers
mailing list