[New-bugs-announce] [issue26707] plistlib fails to parse bplist with 0x80 UID values

John Lehr report at bugs.python.org
Wed Apr 6 21:34:01 EDT 2016

New submission from John Lehr:

libplist raises an invalid file exception on loading properly formed binary plists containing UID (0x80) values.  The binary files were tested for form with plutil.

Comments at line 706 state the value is defined but not in use in plists, and the object is not handled.  However, I find them frequently in bplists, e.g., iOS Snapchat application files.  I have attached a proposed patch that I have tested on these files and can now successfully parse them with the _read_object method in the _BinaryPlistParser class.

My proposed patch is pasted below for others consideration while waiting for the issue to be resolved.

<         # tokenH == 0x80 is documented as 'UID' and appears to be used for
<         # keyed-archiving, not in plists.
>         elif tokenH == 0x80: #UID
>             s = self._get_size(tokenL)
>             return self._fp.read(s).decode('ascii')

Thanks for your consideration.

components: Library (Lib)
files: plistlib_uid.diff
keywords: patch
messages: 262974
nosy: slo.sleuth
priority: normal
severity: normal
status: open
title: plistlib fails to parse bplist with 0x80 UID values
type: crash
versions: Python 3.5
Added file: http://bugs.python.org/file42388/plistlib_uid.diff

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list