]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1574b] added a comment about why ZoneData::origin_data_ is safe to access
authorJINMEI Tatuya <jinmei@isc.org>
Tue, 31 Jan 2012 18:02:44 +0000 (10:02 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Tue, 31 Jan 2012 18:02:44 +0000 (10:02 -0800)
in InMemoryZoneFinder::load()

src/lib/datasrc/memory_datasrc.cc

index 52fd424e7edbbf44a30c7ae53435ccceec0fb137..2a37bddb2f02a3629359753193fe8c8ccc6592bd 100644 (file)
@@ -927,7 +927,10 @@ InMemoryZoneFinder::load(const string& filename) {
 
     // If the zone is NSEC3-signed, check if it has NSEC3PARAM
     if (tmp->nsec3_data_) {
-        assert(!tmp->origin_data_->isEmpty());
+        // Note: origin_data_ is set on creation of ZoneData, and the load
+        // process only adds new nodes (and their data), so this assertion
+        // should hold.
+        assert(tmp->origin_data_ != NULL && !tmp->origin_data_->isEmpty());
         if (tmp->origin_data_->getData()->find(RRType::NSEC3PARAM()) ==
             tmp->origin_data_->getData()->end()) {
             LOG_WARN(logger, DATASRC_MEM_NO_NSEC3PARAM).