summaryrefslogtreecommitdiffstats
path: root/src/out-plutil.c
AgeCommit message (Collapse)AuthorFilesLines
4 daysbytearray: Handle realloc() failure in byte_array_grow()Gravatar Comtea041-0/+7
byte_array_grow() assigned the result of realloc() directly to ba->data and increased the capacity even if realloc() failed, so the following memcpy() in byte_array_append() wrote to NULL + len. On failure, free the old buffer and leave the byte array in a failed state (data == NULL), which byte_array_append() already ignores. The callers check for that state: - the writers (bin, xml, json, openstep and the text output formats) return PLIST_ERR_NO_MEM instead of handing out a NULL/truncated buffer - node_to_xml() base64-encodes <data> directly into the grown buffer, so it must bail out there (only guarded by assert() before) - the OpenStep parser returns PLIST_ERR_NO_MEM for <hex data> instead of silently returning truncated data Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-05-22Print debug error message when encoutering invalid PLIST_DATE valuesGravatar Nikias Bassen1-0/+3
2026-05-22common: validate PLIST_DATE values before Time64_T conversionGravatar Nikias Bassen1-1/+4
Avoid undefined behavior when serializing malformed PLIST_DATE values containing NaN, infinity, or values outside the Time64_T range. Add a shared helper for checked date conversion and use it across writer paths.
2026-05-22refactor: centralize formatting helpers and harden out-plutilGravatar Nikias Bassen1-85/+63
2026-01-17Prevent deep nesting of plist structures in all input/output formatsGravatar Nikias Bassen1-0/+7
Thanks to @unbengable12 for reporting. Addresses #288, #289, #290, #291, and #292.
2026-01-14Add circular reference detection to all format writersGravatar Nikias Bassen1-3/+24
Thanks to @LkkkLxy for pointing out the issue.
2023-05-21Add explicit casts and fix return type mismatchesGravatar Nikias Bassen1-10/+10
2023-05-13Add space before PRI* macros, some compilers do not like itGravatar Nikias Bassen1-2/+2
2023-04-16Add new output-only formats and Define constants for the different plist formatsGravatar Nikias Bassen1-0/+465
This commit introduces constants for the different plist formats, and adds 3 new human-readable output-only formats: - PLIST_FORMAT_PRINT: the default human-readable format - PLIST_FORMAT_LIMD: "libimobiledevice" format (used in ideviceinfo) - PLIST_FORMAT_PLUTIL: plutil-style format Also, a new set of write functions has been added: - plist_write_to_string - plist_write_to_stream - plist_write_to_file Plus a simple "dump" function: - plist_print See documentation for details.