summaryrefslogtreecommitdiffstats
path: root/src/map.c
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@dahyabhai.net>2008-06-21 13:44:17 -0400
committerNalin Dahyabhai <nalin@dahyabhai.net>2008-06-21 13:44:17 -0400
commit96a2fc8a22faec046ab34f3b72e009ef812a6747 (patch)
treeb2f108271e1f86be39ab3af88c1bd2b366fd9fa9 /src/map.c
parent955f661c7f9e98a6296002e6e8c6e900092b8e92 (diff)
downloadslapi-nis-96a2fc8a22faec046ab34f3b72e009ef812a6747.tar.gz
slapi-nis-96a2fc8a22faec046ab34f3b72e009ef812a6747.tar.xz
slapi-nis-96a2fc8a22faec046ab34f3b72e009ef812a6747.zip
- don't fail map_next() when there's no next entry before verifying that there
are still keys left in this entry
Diffstat (limited to 'src/map.c')
-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;