[New-bugs-announce] [issue20434] Process crashes if not enough memory to import module

Vladimir Kerimov report at bugs.python.org
Wed Jan 29 09:36:40 CET 2014


New submission from Vladimir Kerimov:

In the file _io\fileio.c in function 

static PyObject *
fileio_readall(fileio *self)

this code is incorrect and crashes the process of Python:

 if (_PyBytes_Resize(&result, newsize) < 0) {
                if (total == 0) {
                    Py_DECREF(result);
                    return NULL;
                }
                PyErr_Clear();
                break;
            }

In the call of _PyBytes_Resize there the result variable passed by reference and changes value to NULL-pointer when function fails and return < 0. So on the line Py_DECREF(result); the Python process crashes.

----------
components: Interpreter Core
messages: 209624
nosy: asvetlov, qualab
priority: normal
severity: normal
status: open
title: Process crashes if not enough memory to import module
type: crash
versions: Python 3.3

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


More information about the New-bugs-announce mailing list