[issue19568] bytearray_setslice_linear() leaves the bytearray in an inconsistent state on memory allocation failure

STINNER Victor report at bugs.python.org
Thu Nov 21 12:33:35 CET 2013


STINNER Victor added the comment:

> Perhaps the code will be easier if reorganize it.

Ah yes, your version is simpler. I commited your patch, thanks.

I also fixed the XXX to check the integer overflow:

      if (Py_SIZE(self) > (Py_ssize_t)PY_SSIZE_T_MAX - growth) {
          PyErr_NoMemory();
          return -1;
      }

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19568>
_______________________________________


More information about the Python-bugs-list mailing list