From 68ae41b061fd47a3bf04b4ffb01d07be4365b446 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Wed, 29 Jun 2016 17:58:03 +0200 Subject: [PATCH] config-store: (fixes #2442) Do not crash if an object container has a null item --- RELEASE_NOTES | 1 + src/config-store/model/attribute-iterator.cc | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 94c1989da..ede8a35f3 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -76,6 +76,7 @@ Bugs fixed - Bug 2438 - Routing protocols should stop processing packets coming from a non-forwarding interface - Bug 2439 - SixLowPan Compression kind need to be casted to int in the Print function - Bug 2440 - SocketIpTosTag might be added twice if a packet is sent multiple times +- Bug 2442 - TrafficControl makes ConfigStore crash - Bug 2446 - Comma instead of pipe in Attributes Known issues diff --git a/src/config-store/model/attribute-iterator.cc b/src/config-store/model/attribute-iterator.cc index 1641e68b7..30fb80b27 100644 --- a/src/config-store/model/attribute-iterator.cc +++ b/src/config-store/model/attribute-iterator.cc @@ -235,11 +235,14 @@ AttributeIterator::DoIterate (Ptr object) uint32_t j = (*it).first; NS_LOG_DEBUG ("ObjectPtrContainer attribute item " << j); Ptr tmp = (*it).second; - StartVisitArrayItem (vector, j, tmp); - m_examined.push_back (object); - DoIterate (tmp); - m_examined.pop_back (); - EndVisitArrayItem (); + if (tmp) + { + StartVisitArrayItem (vector, j, tmp); + m_examined.push_back (object); + DoIterate (tmp); + m_examined.pop_back (); + EndVisitArrayItem (); + } } EndVisitArrayAttribute (); continue;