1461 static void
1462 libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, const char *msg,
1463 ...)
1464 {
1465 va_list ap;
1466 PyObject *list;
1467 PyObject *message;
1468 PyObject *result;
1469 char str[1000];
1470
1471 #ifdef DEBUG_ERROR
1472 printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
1473 #endif
1474
1475
1476 if (libxml_xmlPythonErrorFuncHandler == NULL) {
when treating unknown struct PyObject * from ./libxml.c:1435 as non-NULL
taking False path
1477 va_start(ap, msg);
1478 vfprintf(stderr, msg, ap);
1479 va_end(ap);
1480 } else {
1481 va_start(ap, msg);
1482 if (vsnprintf(str, 999, msg, ap) >= 998)
when considering range: -0x80000000 <= value <= 997
taking False path
1483 str[999] = 0;
1484 va_end(ap);
1485
1486 list = PyTuple_New(2);
when PyTuple_New() fails
1487 PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
calling PyTuple_SetItem with NULL as argument 1 (list) at ./libxml.c:1487
PyTuple_SetItem() invokes Py_TYPE() on the pointer via the PyTuple_Check() macro, thus accessing (NULL)->ob_type
1488 Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
1489 message = libxml_charPtrConstWrap(str);
1490 PyTuple_SetItem(list, 1, message);
1491 result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
1492 Py_XDECREF(list);
1493 Py_XDECREF(result);
1494 }
1495 }