summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_pickle.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index a689c33..c1facd8 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -489,6 +489,11 @@ unpickler_read(UnpicklerObject *self, char **s, Py_ssize_t n)
return -1;
}
+ if (PyBytes_GET_SIZE(data) != n) {
+ PyErr_SetNone(PyExc_EOFError);
+ return -1;
+ }
+
Py_XDECREF(self->last_string);
self->last_string = data;