#342 ✓resolved
Denis Martinez

libplist unterminated entity reference converting node to xml

Reported by Denis Martinez | 2013-10-14 14:10:45 UTC | 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 &amp; Time|Label for event time</key>
        <string>日期和时间</string>
</dict>
</plist>

Comments and changes to this ticket

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.

New ticket Create new ticket

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

People watching this ticket

Pages