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++ crashes when handling dictionary with adjacent key nodes

#226

I have encountered a problem with reading a plist file as attached. It contains a dictionary with three adjacent key nodes, that is, foo bar baz blah for example. libplist++ will crash on reading it. I know the file is strange but it was found in an well selled iPhone application and I think libplist++ should be able to handle it as plutil using libplist has no problem converting it to plain XML.

One fix of this problem is to add a case PLIST_KEY: before the PLIST_STRING case in Node::FromPlist() in Node.cpp.

Reported by Yin Dian · July 15th, 2011 @ 05:42 PM

State: resolved
Milestone: none
Assigned to: Nikias Bassen Nikias Bassen

Activity

  1. Martin S.
    Martin S.
    • State changed from new to open
    • Tag set to libplist, parsing
    • Assigned user set to Nikias Bassen

    February 24th, 2012 @ 12:14 PM

  2. Nikias Bassen
    Nikias Bassen

    Hi, can you try the attached patch (against latest git master)?

    November 8th, 2012 @ 11:10 PM

  3. Yin Dian
    Yin Dian

    Key.{cpp,h} is missing in cppfix.diff ...

    November 9th, 2012 @ 02:14 AM

  4. Nikias Bassen
    Nikias Bassen

    Sorry forgot the files, attached now. Key.cpp goes to src/Key.cpp and Key.h to include/plist/Key.h
    Would you be able to test if it works as expected? I'm currently busy and don't want to dig into C++ coding right now ;)

    November 9th, 2012 @ 10:34 PM

  5. Yin Dian
    Yin Dian

    Hi, I've just tried your patch and it does work as expected. I have modified SWIG binding accordingly to make it also function in Python, as attached.

    However, in Python binding, Dictionary.iteritems() yields plist.Node instead of dynamic-cast-typed value like plist.String/Key. In addition, iteritems() results in a segmentation fault parsing the somefile.plist in the thread top. This is a separate issue, which could be circumvented by simply using iterkeys() and d[k] instead of iteritems().

    November 12th, 2012 @ 02:53 AM

  6. Nikias Bassen
    Nikias Bassen
    • State changed from open to resolved

    Closing since confirmed working. @Yin Dian if the python issue still exists in the cython extensions please open a new ticket.

    December 13th, 2013 @ 07:16 PM

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.