From 96a2fc8a22faec046ab34f3b72e009ef812a6747 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Sat, 21 Jun 2008 13:44:17 -0400 Subject: - don't fail map_next() when there's no next entry before verifying that there are still keys left in this entry --- src/map.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/map.c b/src/map.c index 9174cf4..f8ed3c7 100644 --- a/src/map.c +++ b/src/map.c @@ -498,7 +498,7 @@ map_next(struct plugin_state *state, return FALSE; } entry = map_data_find_map_entry(state, map, prev_len, prev); - if ((entry == NULL) || (entry->next == NULL)) { + if (entry == NULL) { return FALSE; } *secure = map->secure; @@ -514,6 +514,9 @@ map_next(struct plugin_state *state, *next_value_len = entry->value_len; *next_value = entry->value; } else { + if (entry->next == NULL) { + return FALSE; + } *next_key_len = entry->next->key_len[0]; *next_key = entry->next->keys[0]; *next_value_len = entry->next->value_len; -- cgit