[issue29873] Need a look for return value checking [_elementtree.c]

2017-03-24 Thread Xiang Zhang

Xiang Zhang added the comment:


New changeset 827c78326aa850257ca40991b401b3db298c54fb by Xiang Zhang in branch 
'2.7':
bpo-29873: fix INCREF for possible NULL value in element_getattr() (GH-757)
https://github.com/python/cpython/commit/827c78326aa850257ca40991b401b3db298c54fb


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29873] Need a look for return value checking [_elementtree.c]

2017-03-21 Thread Xiang Zhang

Xiang Zhang added the comment:

Fixed. Thanks for your report Alex.

--
nosy: +xiang.zhang
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29873] Need a look for return value checking [_elementtree.c]

2017-03-21 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +671

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29873] Need a look for return value checking [_elementtree.c]

2017-03-21 Thread Alex CHEN

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com