accept NULL values in hashtable enumerator
authorMartin Willi <martin@strongswan.org>
Fri, 5 Dec 2008 12:34:17 +0000 (12:34 -0000)
committerMartin Willi <martin@strongswan.org>
Fri, 5 Dec 2008 12:34:17 +0000 (12:34 -0000)
src/libstrongswan/utils/hashtable.c

index 9742921..6b53ec2 100644 (file)
@@ -332,8 +332,14 @@ static bool enumerate(private_enumerator_t *this, void **key, void **value)
                        
                        if (this->current->enumerate(this->current, &pair))
                        {
-                               *key = pair->key;
-                               *value = pair->value;
+                               if (key)
+                               {
+                                       *key = pair->key;
+                               }
+                               if (value)
+                               {
+                                       *value = pair->value;
+                               }
                                return TRUE;
                        }
                        this->current->destroy(this->current);