diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-04-03 00:57:33 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-04-03 00:57:33 +0000 |
commit | e02da9669aac78dee544edfd147f671f702177b5 (patch) | |
tree | fec12e43c802d0da4d8411ca840b1d5e61a8d2b4 /Python | |
parent | e1d8cc51de634fbac744198bb41f2e6ea289a0bb (diff) | |
download | cpython-e02da9669aac78dee544edfd147f671f702177b5.tar.gz |
more _PyString_Resize error checking
Diffstat (limited to 'Python')
-rw-r--r-- | Python/marshal.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/marshal.c b/Python/marshal.c index c7015d2eb7..9e4a6926a5 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -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); |