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 71224bb83c252f32cddcc2e325889e71f86737b7
Author: PengZheng <[email protected]>
AuthorDate: Mon Apr 10 18:32:05 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 eb31e173..8fc50104 100644
--- a/libs/framework/include/celix/dm/ServiceDependency_Impl.h
+++ b/libs/framework/include/celix/dm/ServiceDependency_Impl.h
@@ -510,9 +510,7 @@ int 
ServiceDependency<T,I>::invokeCallback(std::function<void(I*, Properties&&)>
     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, "");
             //std::cout << "got property " << key << "=" << value << "\n";
             properties[key] = value;

Reply via email to