mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2026-01-26 21:41:34 +03:00
xmllint: Fix UAF with --push --repeat
Short-lived regression. Fixes #841.
This commit is contained in:
@@ -349,6 +349,7 @@ parseXml(xmllintState *lint, const char *filename) {
|
||||
xmlParseChunk(ctxt, chars, 0, 1);
|
||||
|
||||
doc = ctxt->myDoc;
|
||||
ctxt->myDoc = NULL;
|
||||
if (f != stdin)
|
||||
fclose(f);
|
||||
return(doc);
|
||||
@@ -427,6 +428,7 @@ parseHtml(xmllintState *lint, const char *filename) {
|
||||
}
|
||||
htmlParseChunk(ctxt, chars, 0, 1);
|
||||
doc = ctxt->myDoc;
|
||||
ctxt->myDoc = NULL;
|
||||
if (f != stdin)
|
||||
fclose(f);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user