From a7e82b846543a4fc8d3291a5a65dd66b0cb84396 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 12 Feb 2026 02:10:19 +0100 Subject: plist: make array and dict iterators opaque Introduce private iterator structs for plist_array_iter and plist_dict_iter, and fix *_next_item() to properly advance iterator state and handle malformed containers safely. --- include/plist/plist.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/plist') diff --git a/include/plist/plist.h b/include/plist/plist.h index 8ed9063..b46b9a9 100644 --- a/include/plist/plist.h +++ b/include/plist/plist.h @@ -400,6 +400,12 @@ extern "C" */ PLIST_API void plist_array_next_item(plist_t node, plist_array_iter iter, plist_t *item); + /** + * Free #PLIST_ARRAY iterator. + * + * @param iter Iterator to free. + */ + PLIST_API void plist_array_free_iter(plist_array_iter iter); /******************************************** * * @@ -437,6 +443,13 @@ extern "C" */ PLIST_API void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val); + /** + * Free #PLIST_DICT iterator. + * + * @param iter Iterator to free. + */ + PLIST_API void plist_dict_free_iter(plist_dict_iter iter); + /** * Get key associated key to an item. Item must be member of a dictionary. * -- cgit v1.1-32-gdbae