Age | Commit message (Collapse) | Author | Files | Lines | |
---|---|---|---|---|---|
2023-01-16 | Rename PLIST_UINT to PLIST_INT and add plist_new_int() and plist_get_int_val() | Nikias Bassen | 1 | -3/+3 | |
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. | |||||
2022-02-07 | xplist: Prevent undefined behavior by not trying to negate INT64_MIN | Nikias Bassen | 1 | -1/+1 | |
2021-12-23 | xplist: Add special handling for PLIST_UID parsing from XML | Nikias Bassen | 1 | -5/+14 | |
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. | |||||
2021-12-22 | Add a return value to plist_to_* and plist_from_* functions | Nikias Bassen | 1 | -16/+45 | |
This way it can be easier determined why an import/export operation failed instead of just having a NULL result. | |||||
2021-12-19 | Add support for PLIST_NULL type | Nikias Bassen | 1 | -5/+19 | |
2021-12-19 | Add new plist_mem_free() function | Nikias Bassen | 1 | -5/+0 | |
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(). | |||||
2021-11-08 | xplist: Better size estimation for PLIST_REAL nodes | Nikias Bassen | 1 | -2/+2 | |
2021-06-22 | [clang-tidy] Remove casts to the same type | Rosen Penev | 1 | -1/+1 | |
Found with google-readability-casting Signed-off-by: Rosen Penev <rosenp@gmail.com> | |||||
2021-01-25 | Replace malloc + memset with calloc where appropriate | Rosen Penev | 1 | -2/+1 | |
calloc is faster for big allocations. It's also simpler. Signed-off-by: Rosen Penev <rosenp@gmail.com> | |||||
2020-11-24 | Add parentheses to macros for better readability | Rosen Penev | 1 | -1/+1 | |
[clang-tidy] Found with bugprone-macro-parentheses Signed-off-by: Rosen Penev <rosenp@gmail.com> | |||||
2020-11-24 | Improve code readability by using explicit != 0 compare when using strncmp | Rosen Penev | 1 | -4/+4 | |
[clang-tidy] Found with bugprone-suspicious-string-compare Signed-off-by: Rosen Penev <rosenp@gmail.com> | |||||
2020-06-03 | Remove pointless return in void functions | Rosen Penev | 1 | -2/+0 | |
[clang-tidy] Found with readability-redundant-control-flow Signed-off-by: Rosen Penev <rosenp@gmail.com> | |||||
2019-11-07 | xplist: Bail out when '.' is found while checking for ',' in double to ↵ | Nikias Bassen | 1 | -0/+2 | |
string conversion | |||||
2019-11-07 | Add plist_to_bin_free() and plist_to_xml_free() functions that free memory ↵ | Nikias Bassen | 1 | -0/+5 | |
allocated by plist_to_bin()/plist_to_xml() | |||||
2019-11-07 | xplist: Increase precision when converting PLIST_REAL nodes to XML | Nikias Bassen | 1 | -37/+16 | |
2019-01-21 | xplist: Fix dtostr() inserting ':' to output string when fractional part ↵ | Nikias Bassen | 1 | -2/+15 | |
overflows | |||||
2018-12-17 | xplist: Write base64 directly to output buffer to improve memory usage | Nikias Bassen | 1 | -5/+2 | |
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). | |||||
2018-12-14 | xplist: Improve memory usage by estimating output buffer size | Nikias Bassen | 1 | -2/+127 | |
2018-12-14 | xplist: Fix writing of empty dict and array nodes to XML | Nikias Bassen | 1 | -8/+6 | |
2018-12-11 | xplist: Fix segfault caused by recent changes in libcnary | Nikias Bassen | 1 | -1/+1 | |
2018-12-10 | xplist: Prevent unnecessary reallocations when writing XML output | Nikias Bassen | 1 | -1/+4 | |
2018-12-10 | Remove node_iterator and operate on node list directly to improve memory usage | Nikias Bassen | 1 | -4/+1 | |
2018-09-04 | xplist: Assert when number of child nodes of PLIST_DICT is not even | Nikias Bassen | 1 | -0/+3 | |
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. | |||||
2018-07-25 | xplist: Fix typo in error message | Bastien Nocera | 1 | -1/+1 | |
2017-04-02 | xplist: Plug another memory leak | Nikias Bassen | 1 | -0/+3 | |
Credit to OSS-Fuzz | |||||
2017-03-29 | xplist: Prevent memory leak(s) when parsing fails | Nikias Bassen | 1 | -2/+2 | |
Credit to OSS-Fuzz | |||||
2017-03-29 | xplist: Make XML parsing non-recursive to prevent stack overflow on ↵ | Nikias Bassen | 1 | -79/+103 | |
deep-structured plists Credit to OSS-Fuzz | |||||
2017-02-15 | xplist: Improve writing of large PLIST_DATA nodes by growing buffer in advance | Nikias Bassen | 1 | -0/+1 | |
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. | |||||
2017-02-09 | xplist: Fix OOB heap buffer read with empty data nodes | Nikias Bassen | 1 | -2/+4 | |
Credit to OSS-Fuzz | |||||
2017-02-09 | xplist: Prevent assert when parsing CF$UID dict with invalid value node | Nikias Bassen | 1 | -0/+5 | |
Credit to OSS-Fuzz | |||||
2017-02-08 | xplist: Use proper variable size for integer from string parsing | Nikias Bassen | 1 | -2/+2 | |
2017-02-07 | xplist: Prevent some more strncmp related OOB reads | Nikias Bassen | 1 | -4/+4 | |
2017-02-07 | xplist: Really fix OOB read when parsing DOCTYPE | Nikias Bassen | 1 | -1/+1 | |
2017-02-07 | xplist: unescape_entities(): Make sure text part buffer is null terminated ↵ | Nikias Bassen | 1 | -0/+1 | |
after strncpy | |||||
2017-02-07 | xplist: Fix OOB read when parsing DOCTYPE | Nikias Bassen | 1 | -1/+1 | |
2017-02-07 | xplist: Also fix OOB read in find_char() and find_str() functions | Nikias Bassen | 1 | -0/+8 | |
2017-02-07 | xplist: Prevent OOB read in two more cases | Nikias Bassen | 1 | -0/+10 | |
2017-02-07 | xplist: Fix OOB read when parsing double quotes | Nikias Bassen | 1 | -0/+4 | |
2017-02-07 | xplist: Fix OOB read when parsing node text content | Nikias Bassen | 1 | -1/+1 | |
2017-02-07 | xplist: Catch some more error conditions | Nikias Bassen | 1 | -34/+37 | |
2017-02-06 | xplist: Prevent memory leaks when parsing fails | Nikias Bassen | 1 | -37/+20 | |
2017-01-03 | xplist: Refine XML parsing error messages | Nikias Bassen | 1 | -15/+18 | |
2017-01-02 | xplist: Error out when invalid tags inside text nodes are encountered | Nikias Bassen | 1 | -2/+12 | |
2017-01-02 | xplist: Make sure to error out when encountering empty/incomplete entities | Nikias Bassen | 1 | -1/+5 | |
2017-01-02 | xplist: Make sure to not parse for entities in empty strings | Nikias Bassen | 1 | -1/+1 | |
2017-01-02 | xplist: Allow empty keys in dictionaries | Nikias Bassen | 1 | -2/+2 | |
2017-01-02 | xplist: Allow whitespace after name in closing tag | Nikias Bassen | 1 | -2/+7 | |
'</key >' is a perfectly valid closing tag and so is '</key >' (note the newline). This commit will make the parser skip any encountered whitespace before checking for the closing '>'. | |||||
2017-01-01 | xplist: Fix numerical character entity conversion | Nikias Bassen | 1 | -2/+6 | |
2016-12-21 | xplist: Fix UaF in code checking for closing tag | Nikias Bassen | 1 | -2/+2 | |
2016-12-21 | xplist: Make sure to correctly parse for closing tags of structured nodes | Nikias Bassen | 1 | -7/+45 | |