diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-04-15 19:55:14 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-04-15 19:55:14 (GMT) |
commit | af94051a933b7fbd9c63b0a45cfba5247d92ac14 (patch) | |
tree | 4a1d2acfb1267176d395e7e92c4a7fac6d57b3a8 /Lib/pickle.py | |
parent | acfc454c10ab2fe5dafd4c90a15eaae8cef214c2 (diff) | |
parent | 3034efdd298ad5f94a61f9f0e8ab0fee1d2d212e (diff) | |
download | cpython-af94051a933b7fbd9c63b0a45cfba5247d92ac14.zip cpython-af94051a933b7fbd9c63b0a45cfba5247d92ac14.tar.gz cpython-af94051a933b7fbd9c63b0a45cfba5247d92ac14.tar.bz2 |
Issue #17710: Fix pickle raising a SystemError on bogus input.
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r-- | Lib/pickle.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py index 998fce0..a4acbe9 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -903,7 +903,7 @@ class _Unpickler: orig = self.readline() rep = orig[:-1] # Strip outermost quotes - if rep[0] == rep[-1] and rep[0] in b'"\'': + if len(rep) >= 2 and rep[0] == rep[-1] and rep[0] in b'"\'': rep = rep[1:-1] else: raise ValueError("insecure string pickle") |