Skip to content

Commit a6bf2cb

Browse files
committed
[CVE-2024-56171] Fix use-after-free after xmlSchemaItemListAdd
xmlSchemaItemListAdd can reallocate the items array. Update local variables after adding item in - xmlSchemaIDCFillNodeTables - xmlSchemaBubbleIDCNodeTables Fixes #828.
1 parent 1f37eed commit a6bf2cb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

xmlschemas.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23364,6 +23364,7 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
2336423364
}
2336523365
if (xmlSchemaItemListAdd(bind->dupls, bind->nodeTable[j]) == -1)
2336623366
goto internal_error;
23367+
dupls = (xmlSchemaPSVIIDCNodePtr *) bind->dupls->items;
2336723368
/*
2336823369
* Remove the duplicate entry from the IDC node-table.
2336923370
*/
@@ -23580,6 +23581,8 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
2358023581
goto internal_error;
2358123582
}
2358223583
xmlSchemaItemListAdd(parBind->dupls, parNode);
23584+
dupls = (xmlSchemaPSVIIDCNodePtr *)
23585+
parBind->dupls->items;
2358323586
} else {
2358423587
/*
2358523588
* Add the node-table entry (node and key-sequence) of

0 commit comments

Comments
 (0)