1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-27 04:55:04 +03:00

parser: Don't check inputNr in xmlParseTryOrFinish

There's no apparent reason for this check. inputNr should always be 1
here.
This commit is contained in:
Nick Wellnhofer 2023-08-29 15:58:22 +02:00
parent e48f2695fe
commit 1edae30f82

View File

@ -11029,7 +11029,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
int line = ctxt->input->line; int line = ctxt->input->line;
int nsNr = ctxt->nsNr; int nsNr = ctxt->nsNr;
if ((avail < 2) && (ctxt->inputNr == 1)) if (avail < 2)
goto done; goto done;
cur = ctxt->input->cur[0]; cur = ctxt->input->cur[0];
if (cur != '<') { if (cur != '<') {
@ -11124,7 +11124,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
break; break;
} }
case XML_PARSER_CONTENT: { case XML_PARSER_CONTENT: {
if ((avail < 2) && (ctxt->inputNr == 1)) if (avail < 2)
goto done; goto done;
cur = ctxt->input->cur[0]; cur = ctxt->input->cur[0];
next = ctxt->input->cur[1]; next = ctxt->input->cur[1];
@ -11188,8 +11188,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
* callbacks between the push and pull versions * callbacks between the push and pull versions
* of the parser. * of the parser.
*/ */
if ((ctxt->inputNr == 1) && if (avail < XML_PARSER_BIG_BUFFER_SIZE) {
(avail < XML_PARSER_BIG_BUFFER_SIZE)) {
if ((!terminate) && (!xmlParseLookupCharData(ctxt))) if ((!terminate) && (!xmlParseLookupCharData(ctxt)))
goto done; goto done;
} }