Issue4298
Created on 2008-11-11 15:07 by hagen, last changed 2022-04-11 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| py3k_set_EOFError_when_invalid_result_size.patch | ocean-city, 2008-11-11 16:45 | |||
| Messages (3) | |||
|---|---|---|---|
| msg75743 - (view) | Author: Hagen Fürstenau (hagen) | Date: 2008-11-11 15:07 | |
On a 64-bit build pickle.loads segfaults on the following bytes. (Same for pickle.load on a corresponding file.) On a 32-bit build there is only a MemoryError. Python 3.0rc2 (r30rc2:67114, Nov 10 2008, 12:09:54) [GCC 4.1.2 20070925 (Red Hat 4.1.2-27)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pickle >>> pickle.loads(bytes([0x58, 0, 0, 0, 0x54])) Segmentation fault |
|||
| msg75748 - (view) | Author: Hirokazu Yamamoto (ocean-city) * ![]() |
Date: 2008-11-11 16:45 | |
See trunk/Modules/cPickle.c(609).
static Py_ssize_t
read_cStringIO(Unpicklerobject *self, char **s, Py_ssize_t n)
{
char *ptr;
if (PycStringIO->cread((PyObject *)self->file, &ptr, n) != n) {
PyErr_SetNone(PyExc_EOFError);
return -1;
}
*s = ptr;
return n;
}
It's checking the length of returned string and if not match, raises
EOFError. But there is no corresponding code in py3k.
I hope attached patch will fix this issue.
|
|||
| msg75758 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * ![]() |
Date: 2008-11-11 20:05 | |
Fixed in r67187. Thanks for the report, and for the patch! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:56:41 | admin | set | github: 48548 |
| 2008-11-11 20:05:39 | amaury.forgeotdarc | set | status: open -> closed resolution: fixed messages: + msg75758 nosy: + amaury.forgeotdarc |
| 2008-11-11 16:45:42 | ocean-city | set | files:
+ py3k_set_EOFError_when_invalid_result_size.patch keywords: + patch messages: + msg75748 nosy: + ocean-city |
| 2008-11-11 15:07:50 | hagen | create | |
