| Age | Commit message (Collapse) | Author | Files | Lines |
|
This change adds stricter validation for numeric and date nodes,
including full-input consumption, overflow/range checks, and rejection
of invalid floating-point values. Whitespace handling is clarified by
explicitly trimming trailing XML whitespace for value nodes.
|
|
This removes the necessity for malloc failures and reduces overhead
|
|
|
|
- Fix numeric character reference parsing
- Enforce exact entity name matching
- Guard against size_t underflow and oversized entities
- Reject invalid Unicode code points
|
|
Thanks to @unbengable12 for reporting. Addresses #288, #289, #290, #291, and #292.
|
|
Thanks to @LkkkLxy for pointing out the issue.
|
|
Even though this is weird, the DTD allows it. This commit will also make
the XML output write `<key/>` and `<string/>` instead of `<key></key>` and `<string></string>`
in case of empty key/string node.
|
|
Thanks to @ylwango613 for reporting
|
|
|
|
|
|
|
|
|
|
the format parses
This makes the `-d` option work in plistutil that wasn't doing anything
|
|
This makes the code more readable. Obviously all the code that uses it
is also updated.
|
|
|
|
This properly supports getting and setting signed or unsigned integer values.
Also, a new helper function plist_int_val_is_negative() was added to determine if
a given #PLIST_INT node has a negative value or not.
The old type PLIST_UINT is defined as a macro with the value of PLIST_INT for
backwards compatibility.
This commit also adds int vs. uint support to the C++ interface, and the python
bindings in a hopefully useful way.
|
|
|
|
In XML, PLIST_UID nodes are stored as a dict with a "CF$UID" key and an
integer value, so we want to make it a real PLIST_UID node internally.
|
|
This way it can be easier determined why an import/export operation failed
instead of just having a NULL result.
|
|
|
|
Thanks to @azerg for bringing this to my attention.
Instead of having multiple (internally identical) plist_*_free() functions,
this commit introduces a single plist_mem_free() that can be used to free
the memory allocated by plist_to_xml(), plist_to_bin(), plist_get_key_val(),
plist_get_string_val(), and plist_get_data_val().
Note: This commit REMOVES plist_to_bin_free() and plist_to_xml_free().
|
|
|
|
Found with google-readability-casting
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
calloc is faster for big allocations. It's also simpler.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
[clang-tidy] Found with bugprone-macro-parentheses
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
[clang-tidy] Found with bugprone-suspicious-string-compare
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
[clang-tidy] Found with readability-redundant-control-flow
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
string conversion
|
|
allocated by plist_to_bin()/plist_to_xml()
|
|
|
|
overflows
|
|
Now that we grow the output buffer enough before writing XML output we can
just write the base64 encoded data directly to the ouput buffer instead of
using a heap buffer that will then be copied to the output buffer.
This makes writing XML output more memory efficient (and slightly faster).
|
|
|
|
|
|
|
|
|
|
|
|
This should only happen due to misuse of the library, e.g. when
calling plist_free() on a node that is a value node in a PLIST_DICT
without properly removing the dictionary entry (key/value pair) and
then calling plist_to_xml() on that dictionary.
|
|
|
|
Credit to OSS-Fuzz
|
|
Credit to OSS-Fuzz
|
|
deep-structured plists
Credit to OSS-Fuzz
|
|
Instead of letting the buffer grow by just the amount of bytes currently
transformed to base64 - which is basically line by line - we now calculate
the size of the output blob in advance and grow the buffer accordingly.
This will reduce the amount of reallocs to just one, which is especially
important for large data blobs.
While this is a general improvement for all platforms, it is on platforms
like Windows where realloc() can be REALLY slow; converting a 20mb blob to
XML can easily take up to a minute (due to the several hundred thousand
calls to realloc()). With this commit, it will be fast again.
|
|
Credit to OSS-Fuzz
|
|
Credit to OSS-Fuzz
|
|
|
|
|
|
|
|
after strncpy
|
|
|