#4298: pickle.load() can segfault on invalid or truncated input.

Patch and test by Hirokazu Yamamoto.
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 @@
         return -1;
     }
 
+    if (PyBytes_GET_SIZE(data) != n) {
+        PyErr_SetNone(PyExc_EOFError);
+        return -1;
+    }
+
     Py_XDECREF(self->last_string);
     self->last_string = data;