libplist unterminated entity reference converting node to xml
Reported by Denis Martinez | October 14th, 2013 @ 02:10 PM | in 1.2.0 Release
When libplist converts dictionary keys containing special characters, the conversion fails with the libxml2 error: unterminated entity reference.
In the source file xplist.c, if the following modification is made:
if (node_data->type == PLIST_STRING) {
to:
if (node_data->type == PLIST_STRING || node_data->type == PLIST_KEY) {
The xml file is output as expected.
The test file as binary plist is the following: (base64 encoded)
YnBsaXN0MDDRAQJfECBEYXRlICYgVGltZXxMYWJlbCBmb3IgZXZlbnQgdGltZWVl5WcfVIxl9pX0
CAsuAAAAAAAAAQEAAAAAAAAAAwAAAAAAAAAAAAAAAAAAADk=
This is the error output:
error : unterminated entity reference Time|Label for event time
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key/>
<string>日期和时间</string>
</dict>
</plist>
Expected:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Date & Time|Label for event time</key>
<string>日期和时间</string>
</dict>
</plist>
Comments and changes to this ticket
-
Martin S. May 27th, 2014 @ 08:46 AM
- State changed from new to resolved
- Assigned user set to Martin S.
- Milestone set to 1.2.0 Release
Thanks, interesting find. Fixed in git HEAD.
This ticket tracker is deprecated as we've moved to github.com/libimobiledevice.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
A project around supporting the iPhone in Linux.
See http://libimobiledevice.org