aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2003-10-30 13:12:43 +0000
committerDaniel Veillard <veillard@src.gnome.org>2003-10-30 13:12:43 +0000
commitbb3ba326e6ba5b661ca51aab53b17f519eda5924 (patch)
tree93a9b11d5a15eef2cfeb28e7a17627f013a869d0 /python
parente133dd8d13bbb32684b5fc7a2f329a71fcf944aa (diff)
downloadandroid_external_libxml2-bb3ba326e6ba5b661ca51aab53b17f519eda5924.tar.gz
android_external_libxml2-bb3ba326e6ba5b661ca51aab53b17f519eda5924.tar.bz2
android_external_libxml2-bb3ba326e6ba5b661ca51aab53b17f519eda5924.zip
be more defensive in the xmlReader python bindings fixing bug #124044
* python/libxml.c: be more defensive in the xmlReader python bindings fixing bug #124044 Daniel
Diffstat (limited to 'python')
-rw-r--r--python/libxml.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/libxml.c b/python/libxml.c
index 2860bca8..2ae18560 100644
--- a/python/libxml.c
+++ b/python/libxml.c
@@ -1644,9 +1644,17 @@ libxml_xmlFreeTextReader(ATTRIBUTE_UNUSED PyObject *self, PyObject *args) {
xmlTextReaderErrorFunc f;
void *arg;
+ if (self == NULL) {
+ Py_INCREF(Py_None);
+ return(Py_None);
+ }
if (!PyArg_ParseTuple(args, (char *)"O:xmlFreeTextReader", &pyobj_reader))
return(NULL);
reader = (xmlTextReaderPtr) PyxmlTextReader_Get(pyobj_reader);
+ if (reader == NULL) {
+ Py_INCREF(Py_None);
+ return(Py_None);
+ }
xmlTextReaderGetErrorHandler(reader,&f,&arg);
if (arg != NULL) {