summaryrefslogtreecommitdiffstats
path: root/src/ptrarray.h
AgeCommit message (Collapse)AuthorFilesLines
7 daysptrarray: Handle realloc() failure in ptr_array_insert()Gravatar Comtea041-2/+2
ptr_array_insert() assigned the result of realloc() directly to pa->pdata and bumped the capacity without checking for failure, so on out-of-memory the old buffer was leaked and the following store or memmove() wrote through a NULL pointer. Keep the old buffer on failure and return -1 from ptr_array_insert() and ptr_array_add(). The callers now handle the error: - the array lookup cache (plist.c) is dropped instead of silently going out of sync with the node list; lookups then fall back to walking the children, as they do before the cache exists - bplist parsing (used_indexes) and serialization (objects) return PLIST_ERR_NO_MEM; ignoring the error in parse_bin_node_at_index() would otherwise loop forever since the array never grows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2019-12-09ptrarray: Add function returning the size (number of elements) of the arrayGravatar XD1-0/+1
2019-05-19Add index lookup table for large PLIST_ARRAY nodesGravatar Nikias Bassen1-5/+8
2014-10-03Avoid exporting non-public symbolsGravatar Nikias Bassen1-5/+4
2011-05-27Make libplist glib freeGravatar Nikias Bassen1-0/+37