1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

Fix hash callback signatures

Make sure that all parameters and return values of hash callback
functions exactly match the callback function type. This is required
to pass clang's Control Flow Integrity checks and to allow compilation
to asm.js with Emscripten.

Fixes bug 784861.
This commit is contained in:
Nick Wellnhofer
2017-11-09 16:42:47 +01:00
parent 71462a6006
commit e03f0a199a
16 changed files with 235 additions and 143 deletions

View File

@ -1229,8 +1229,11 @@ xmlCtxtDumpDocument(xmlDebugCtxtPtr ctxt, xmlDocPtr doc)
}
static void
xmlCtxtDumpEntityCallback(xmlEntityPtr cur, xmlDebugCtxtPtr ctxt)
xmlCtxtDumpEntityCallback(void *payload, void *data,
const xmlChar *name ATTRIBUTE_UNUSED)
{
xmlEntityPtr cur = (xmlEntityPtr) payload;
xmlDebugCtxtPtr ctxt = (xmlDebugCtxtPtr) data;
if (cur == NULL) {
if (!ctxt->check)
fprintf(ctxt->output, "Entity is NULL");
@ -1289,8 +1292,7 @@ xmlCtxtDumpEntities(xmlDebugCtxtPtr ctxt, xmlDocPtr doc)
if (!ctxt->check)
fprintf(ctxt->output, "Entities in internal subset\n");
xmlHashScan(table, (xmlHashScanner) xmlCtxtDumpEntityCallback,
ctxt);
xmlHashScan(table, xmlCtxtDumpEntityCallback, ctxt);
} else
fprintf(ctxt->output, "No entities in internal subset\n");
if ((doc->extSubset != NULL) && (doc->extSubset->entities != NULL)) {
@ -1299,8 +1301,7 @@ xmlCtxtDumpEntities(xmlDebugCtxtPtr ctxt, xmlDocPtr doc)
if (!ctxt->check)
fprintf(ctxt->output, "Entities in external subset\n");
xmlHashScan(table, (xmlHashScanner) xmlCtxtDumpEntityCallback,
ctxt);
xmlHashScan(table, xmlCtxtDumpEntityCallback, ctxt);
} else if (!ctxt->check)
fprintf(ctxt->output, "No entities in external subset\n");
}