mirror of https://github.com/python/cpython.git
Propagate error when PyByteArray_Resize() fails in bytearray_translate()
CID 715334
This commit is contained in:
parent
8e0908495a
commit
c731bbe665
|
@ -1506,7 +1506,10 @@ bytearray_translate(PyByteArrayObject *self, PyObject *args)
|
|||
}
|
||||
/* Fix the size of the resulting string */
|
||||
if (inlen > 0)
|
||||
PyByteArray_Resize(result, output - output_start);
|
||||
if (PyByteArray_Resize(result, output - output_start) < 0) {
|
||||
Py_CLEAR(result);
|
||||
goto done;
|
||||
}
|
||||
|
||||
done:
|
||||
if (tableobj != NULL)
|
||||
|
|
Loading…
Reference in New Issue