[New-bugs-announce] [issue29682] Checks for null return value
Alex CHEN
report at bugs.python.org
Wed Mar 1 00:54:36 EST 2017
New submission from Alex CHEN:
Hi,
Our tool reported a position that doesn't check for returned value (from a function that might returns null). might need a look that is there any problem or I am missing something.
in function PyUnknownEncodingHandler of file pyexpat.c,
if (namespace_separator != NULL) {
self->itself = XML_ParserCreateNS(encoding, *namespace_separator);
}
else {
self->itself = XML_ParserCreate(encoding); // could XML_ParserCreate returns null in this point?
}
.....
XML_SetHashSalt(self->itself, // if it does return null, null pointer will passed into XML_SetHashSalt and will be dereferenced.
(unsigned long)_Py_HashSecret.prefix);
#endif
----------
messages: 288739
nosy: alexc
priority: normal
severity: normal
status: open
title: Checks for null return value
versions: Python 2.7
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29682>
_______________________________________
More information about the New-bugs-announce
mailing list