[issue23094] Unpickler failing with PicklingError at frame end on readline due to a broken comparison
Serhiy Storchaka
report at bugs.python.org
Sun Dec 21 08:57:26 CET 2014
Serhiy Storchaka added the comment:
readline() is used only when unpickle opcodes PERSID, INT, LONG, FLOAT, STRING, UNICODE, INST, GLOBAL, GET, PUT. These opcodes are not used with protocol 4 (all opcodes except GLOBAL is used only with protocol 0, and GLOBAL is used with protocol <= 3). Frames are used only with protocol 4. So there is very small chance to meet this bug in real data. But it is not zero, artificial pickled data which mixes FRAME with protocol 0 opcodes can be constructed by third-party software for some reasons.
Artificial example:
>>> pickletools.dis(b"\x80\x04\x95\x05\x00\x00\x00\x00\x00\x00\x00I42\n.")
0: \x80 PROTO 4
2: \x95 FRAME 5
11: I INT 42
15: . STOP
highest protocol among opcodes = 4
----------
components: +Library (Lib)
stage: -> needs patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23094>
_______________________________________
More information about the Python-bugs-list
mailing list