This is an automated email from the ASF dual-hosted git repository. pengzheng pushed a commit to branch hotfix/coverity_fix in repository https://gitbox.apache.org/repos/asf/celix.git
commit f569258b012c46e4e13fda19c9e67d4ef8939f37 Author: PengZheng <[email protected]> AuthorDate: Mon Apr 10 18:29:43 2023 +0800 Fix Coverity 301214 Dereference null return value. --- libs/framework/include/celix/dm/ServiceDependency_Impl.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/framework/include/celix/dm/ServiceDependency_Impl.h b/libs/framework/include/celix/dm/ServiceDependency_Impl.h index 9fd11dfd..eb31e173 100644 --- a/libs/framework/include/celix/dm/ServiceDependency_Impl.h +++ b/libs/framework/include/celix/dm/ServiceDependency_Impl.h @@ -242,9 +242,7 @@ int CServiceDependency<T,I>::invokeCallback(std::function<void(const I*, Propert const char* value {nullptr}; if (props != nullptr) { - celix_properties_iterator_t iter = celix_propertiesIterator_construct(props); - while(celix_propertiesIterator_hasNext(&iter)) { - key = (const char*) celix_propertiesIterator_nextKey(&iter); + CELIX_PROPERTIES_FOR_EACH(props, key) { value = celix_properties_get(props, key, ""); //note. C++ does not allow nullptr entries for std::string //std::cout << "got property " << key << "=" << value << "\n"; properties[key] = value;
