1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-19 14:50:07 +03:00

parser: Fix parsing of DTD content

Regressed in 2.11. Fixes #868.
This commit is contained in:
Nick Wellnhofer 2025-03-01 10:25:29 +01:00
parent 552864f109
commit 05bd1720ce
8 changed files with 42 additions and 1 deletions

View File

@ -7234,7 +7234,11 @@ xmlParseMarkupDecl(xmlParserCtxtPtr ctxt) {
xmlParseComment(ctxt);
break;
default:
/* there is an error but it will be detected later */
xmlFatalErr(ctxt,
ctxt->inSubset == 2 ?
XML_ERR_EXT_SUBSET_NOT_FINISHED :
XML_ERR_INT_SUBSET_NOT_FINISHED,
NULL);
SKIP(2);
break;
}

View File

@ -20,5 +20,11 @@ Entity: line 1:
%xx;
^
Entity: line 2:
<![INCLUDE[
^
./test/errors/759573-2.xml:6: parser error : Content error in the internal subset
%xx;
^
Entity: line 2:
<![INCLUDE[
^

View File

@ -20,5 +20,11 @@ Entity: line 1:
%xx;
^
Entity: line 2:
<![INCLUDE[
^
./test/errors/759573-2.xml:6: parser error : Content error in the internal subset
%xx;
^
Entity: line 2:
<![INCLUDE[
^

View File

@ -20,6 +20,12 @@ Entity: line 1:
%xx;
^
Entity: line 2:
<![INCLUDE[
^
./test/errors/759573-2.xml:6: parser error : Content error in the internal subset
%xx;
^
Entity: line 2:
<![INCLUDE[
^
./test/errors/759573-2.xml : failed to parse

View File

@ -0,0 +1,3 @@
./test/errors/issue868.xml:3: parser error : Content error in the internal subset
<!]>
^

View File

@ -0,0 +1,3 @@
./test/errors/issue868.xml:3: parser error : Content error in the internal subset
<!]>
^

View File

@ -0,0 +1,4 @@
./test/errors/issue868.xml:3: parser error : Content error in the internal subset
<!]>
^
./test/errors/issue868.xml : failed to parse

9
test/errors/issue868.xml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE rss [
<!]>
<rss>
<channel>
<image/>
<title>PP</title>
</channel>
</rss>