Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit 0cde1b7

Browse files
committed
parser: Fix "Truncated multi-byte sequence" error
Don't raise the error if decoding failed.
1 parent 02cbb2b commit 0cde1b7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

parser.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10584,6 +10584,7 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
1058410584
xmlFatalErr(ctxt, XML_ERR_DOCUMENT_END, NULL);
1058510585
} else if ((ctxt->input->buf != NULL) &&
1058610586
(ctxt->input->buf->encoder != NULL) &&
10587+
(ctxt->input->buf->error == 0) &&
1058710588
(!xmlBufIsEmpty(ctxt->input->buf->raw))) {
1058810589
xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
1058910590
"Truncated multi-byte sequence at EOF\n");
@@ -11589,6 +11590,7 @@ xmlParseChunk(xmlParserCtxtPtr ctxt, const char *chunk, int size,
1158911590
}
1159011591
} else if ((ctxt->input->buf != NULL) &&
1159111592
(ctxt->input->buf->encoder != NULL) &&
11593+
(ctxt->input->buf->error == 0) &&
1159211594
(!xmlBufIsEmpty(ctxt->input->buf->raw))) {
1159311595
xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
1159411596
"Truncated multi-byte sequence at EOF\n");

0 commit comments

Comments
 (0)