summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2019-11-24 19:15:08 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-11-24 19:15:08 (GMT)
commit6f03b236c17c96bc9f8a004ffa7e7ae0542e9cac (patch)
treea3c37873c66b49cfe26b7b7183b75adead85b37b /Misc
parente407646b741db6851789963e525a1f5daad0a336 (diff)
downloadcpython-6f03b236c17c96bc9f8a004ffa7e7ae0542e9cac.zip
cpython-6f03b236c17c96bc9f8a004ffa7e7ae0542e9cac.tar.gz
cpython-6f03b236c17c96bc9f8a004ffa7e7ae0542e9cac.tar.bz2
bpo-38876: Raise pickle.UnpicklingError when loading an item from memo for invalid input (GH-17335)
The previous code was raising a `KeyError` for both the Python and C implementation. This was caused by the specified index of an invalid input which did not exist in the memo structure, where the pickle stores what objects it has seen. The malformed input would have caused either a `BINGET` or `LONG_BINGET` load from the memo, leading to a `KeyError` as the determined index was bogus. https://bugs.python.org/issue38876 https://bugs.python.org/issue38876
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2019-11-22-10-58-58.bpo-38876.qqy1Vp.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2019-11-22-10-58-58.bpo-38876.qqy1Vp.rst b/Misc/NEWS.d/next/Library/2019-11-22-10-58-58.bpo-38876.qqy1Vp.rst
new file mode 100644
index 0000000..43b25ac
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-11-22-10-58-58.bpo-38876.qqy1Vp.rst
@@ -0,0 +1,9 @@
+Raise pickle.UnpicklingError when loading an item from memo for invalid
+input
+
+The previous code was raising a `KeyError` for both the Python and C
+implementation. This was caused by the specified index of an invalid input
+which did not exist in the memo structure, where the pickle stores what
+objects it has seen. The malformed input would have caused either a `BINGET`
+or `LONG_BINGET` load from the memo, leading to a `KeyError` as the
+determined index was bogus. Patch by Claudiu Popa