mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-18 16:08:59 +03:00
added a check on the argument for some classes (e.g. xmlDoc and xmlNode)
* python/generator.py: added a check on the argument for some classes (e.g. xmlDoc and xmlNode) to prevent a segfault (as reported on the list). Further enhancement should be done to auto-create the appropriate object. * python/libxml.c: minor fix for a warning message; added a routine, currently not used, to report the description of a PyCObject. * python/libxml2class.txt: regenerated
This commit is contained in:
@@ -95,7 +95,8 @@ static void
|
||||
libxml_xmlErrorInitialize(void); /* forward declare */
|
||||
|
||||
PyObject *
|
||||
libxml_xmlMemoryUsed(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
|
||||
libxml_xmlMemoryUsed(PyObject * self ATTRIBUTE_UNUSED,
|
||||
PyObject * args ATTRIBUTE_UNUSED)
|
||||
{
|
||||
long ret;
|
||||
PyObject *py_retval;
|
||||
@@ -107,7 +108,7 @@ libxml_xmlMemoryUsed(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlDebugMemory(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
|
||||
libxml_xmlDebugMemory(PyObject * self ATTRIBUTE_UNUSED, PyObject * args)
|
||||
{
|
||||
int activate;
|
||||
PyObject *py_retval;
|
||||
@@ -3242,7 +3243,17 @@ libxml_C14NDocSaveTo(ATTRIBUTE_UNUSED PyObject * self,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static PyObject *
|
||||
libxml_getObjDesc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
||||
|
||||
PyObject *obj;
|
||||
char *str;
|
||||
|
||||
if (!PyArg_ParseTuple(args, (char *)"O:getObjDesc", &obj))
|
||||
return NULL;
|
||||
str = PyCObject_GetDesc(obj);
|
||||
return Py_BuildValue((char *)"s", str);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
@@ -3289,6 +3300,7 @@ static PyMethodDef libxmlMethods[] = {
|
||||
{(char *)"xmlC14NDocSaveTo", libxml_C14NDocSaveTo, METH_VARARGS, NULL},
|
||||
#endif
|
||||
#endif
|
||||
{(char *) "getObjDesc", libxml_getObjDesc, METH_VARARGS, NULL},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user