Propagate error when PyByteArray_Resize() fails in bytearray_translate()
CID 715334
This commit is contained in:
commit
6895947570
|
@ -1508,7 +1508,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