summaryrefslogtreecommitdiffstats
path: root/Lib/pickle.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-04-15 19:51:09 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-04-15 19:51:09 (GMT)
commit3034efdd298ad5f94a61f9f0e8ab0fee1d2d212e (patch)
tree42236d2d7518cd4f214de096919718811e7ad3fa /Lib/pickle.py
parented3cd7e445e7be413d1b454471454f7ff9f21f1f (diff)
downloadcpython-3034efdd298ad5f94a61f9f0e8ab0fee1d2d212e.zip
cpython-3034efdd298ad5f94a61f9f0e8ab0fee1d2d212e.tar.gz
cpython-3034efdd298ad5f94a61f9f0e8ab0fee1d2d212e.tar.bz2
Issue #17710: Fix pickle raising a SystemError on bogus input.
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r--Lib/pickle.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index e81a379..161c2e9 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -951,7 +951,7 @@ class _Unpickler:
rep = orig[:-1]
for q in (b'"', b"'"): # double or single quote
if rep.startswith(q):
- if not rep.endswith(q):
+ if len(rep) < 2 or not rep.endswith(q):
raise ValueError("insecure string pickle")
rep = rep[len(q):-len(q)]
break