msxml3: Use correct string length in saxreader_get_cdata_chunk.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2017-10-05 14:59:56 +02:00 committed by Alexandre Julliard
parent 1a114c9f4b
commit afdf7491ef

View file

@ -1972,6 +1972,7 @@ static BSTR saxreader_get_cdata_chunk(const xmlChar *str, int len)
BSTR bstr = bstr_from_xmlCharN(str, len), ret; BSTR bstr = bstr_from_xmlCharN(str, len), ret;
WCHAR *ptr; WCHAR *ptr;
len = SysStringLen(bstr);
ptr = bstr + len - 1; ptr = bstr + len - 1;
while ((*ptr == '\r' || *ptr == '\n') && ptr >= bstr) while ((*ptr == '\r' || *ptr == '\n') && ptr >= bstr)
ptr--; ptr--;
@ -2038,7 +2039,7 @@ static void libxml_cdatablock(void *ctx, const xmlChar *value, int len)
while (i < len) while (i < len)
{ {
if (value[i] != '\r' && value[i] != '\n') break; if (value[i] != '\r' && value[i] != '\n') break;
i++; i++;
} }
end = &value[i]; end = &value[i];