[New-bugs-announce] [issue29873] Need a look for return value checking [_elementtree.c]

Alex CHEN report at bugs.python.org
Tue Mar 21 23:39:35 EDT 2017


New submission from Alex CHEN:

In file _elementtree.c

our static code scanner has reported this case, but I don't sure that could be any problem, may you have a look?

static PyObject*  
element_getattr(ElementObject* self, char* name)
{
    PyObject* res;

    /* handle common attributes first */
    if (strcmp(name, "tag") == 0) {
        res = self->tag;
        Py_INCREF(res);
        return res;
    } else if (strcmp(name, "text") == 0) {
        res = element_get_text(self);         // is it possible that element_get_text could return NULL here?
        Py_INCREF(res);
        return res;
    }

----------
components: XML
messages: 289965
nosy: alexc
priority: normal
severity: normal
status: open
title: Need a look for return value checking [_elementtree.c]
type: crash
versions: Python 2.7

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


More information about the New-bugs-announce mailing list