more _PyString_Resize error checking

This commit is contained in:
Benjamin Peterson 2010-04-03 00:57:33 +00:00
parent 3928276e64
commit bea424af98
3 changed files with 20 additions and 13 deletions

View file

@ -1237,7 +1237,8 @@ PyMarshal_WriteObjectToString(PyObject *x, int version)
"too much marshall data for a string");
return NULL;
}
_PyString_Resize(&wf.str, (Py_ssize_t)(wf.ptr - base));
if (_PyString_Resize(&wf.str, (Py_ssize_t)(wf.ptr - base)))
return NULL;
}
if (wf.error != WFERR_OK) {
Py_XDECREF(wf.str);