Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

libplist unterminated entity reference converting node to xml

#342

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>

Reported by Denis Martinez · October 14th, 2013 @ 02:10 PM

State: resolved
Milestone: 1.2.0 Release
Assigned to: Martin S. Martin S.

Activity

  1. Martin S.
    Martin S.
    • 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.

    May 27th, 2014 @ 08:46 AM

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.