libplist++ crashes when handling dictionary with adjacent key nodes
Reported by Yin Dian | July 15th, 2011 @ 05:42 PM
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.
Comments and changes to this ticket
-
Martin S. February 24th, 2012 @ 12:14 PM
- State changed from new to open
- Tag set to libplist, parsing
- Assigned user set to Nikias Bassen
-
Nikias Bassen November 8th, 2012 @ 11:10 PM
Hi, can you try the attached patch (against latest git master)?
-
Nikias Bassen November 9th, 2012 @ 10:34 PM
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 ;) -
Yin Dian November 12th, 2012 @ 02:53 AM
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().
-
Nikias Bassen December 13th, 2013 @ 07:16 PM
- 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.
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
People watching this ticket
Attachments
Referenced by
- 289 当plist里有两个key时会报错 Seems similar problem to #226, but #226 is for plist++. p...
- 289 当plist里有两个key时会报错 Seems similar problem to #226, but #226 is for plist++. p...