1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

parser: Fix xmlInputSetEncodingHandler again

Short-lived regression.
This commit is contained in:
Nick Wellnhofer 2024-07-11 12:37:25 +02:00
parent 8af55c8d20
commit aa6aec19b0

View File

@ -1299,6 +1299,7 @@ xmlInputSetEncodingHandler(xmlParserInputPtr input,
xmlParserInputBufferPtr in;
xmlBufPtr buf;
int nbchars;
int code = XML_ERR_OK;
if ((input == NULL) || (input->buf == NULL)) {
xmlCharEncCloseFunc(handler);
@ -1348,7 +1349,7 @@ xmlInputSetEncodingHandler(xmlParserInputPtr input,
/*
* Is there already some content down the pipe to convert ?
*/
if (input->end > input->cur) {
if (input->end > input->base) {
size_t processed;
/*
@ -1361,12 +1362,13 @@ xmlInputSetEncodingHandler(xmlParserInputPtr input,
in->rawconsumed = processed;
nbchars = xmlCharEncInput(in);
xmlBufResetInput(in->buffer, input);
if (nbchars < 0)
return(in->error);
code = in->error;
}
return(XML_ERR_OK);
xmlBufResetInput(in->buffer, input);
return(code);
}
/**