summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/map.c5
1 files changed, 4 insertions, 1 deletions
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;