diff --git a/reactos/include/reactos/libs/libxml/tree.h b/reactos/include/reactos/libs/libxml/tree.h index 2f90717c1b4..4a9b3bc6347 100644 --- a/reactos/include/reactos/libs/libxml/tree.h +++ b/reactos/include/reactos/libs/libxml/tree.h @@ -76,7 +76,8 @@ typedef enum { XML_BUFFER_ALLOC_EXACT, /* grow only to the minimal size */ XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer */ XML_BUFFER_ALLOC_IO, /* special allocation scheme used for I/O */ - XML_BUFFER_ALLOC_HYBRID /* exact up to a threshold, and doubleit thereafter */ + XML_BUFFER_ALLOC_HYBRID, /* exact up to a threshold, and doubleit thereafter */ + XML_BUFFER_ALLOC_BOUNDED /* limit the upper size of the buffer */ } xmlBufferAllocationScheme; /** diff --git a/reactos/include/reactos/libs/libxml/xmlversion.h b/reactos/include/reactos/libs/libxml/xmlversion.h index 92f1352371a..0c4e1c375f3 100644 --- a/reactos/include/reactos/libs/libxml/xmlversion.h +++ b/reactos/include/reactos/libs/libxml/xmlversion.h @@ -29,28 +29,28 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.9.2" +#define LIBXML_DOTTED_VERSION "2.9.3" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 20902 +#define LIBXML_VERSION 20903 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "20902" +#define LIBXML_VERSION_STRING "20903" /** * LIBXML_VERSION_EXTRA: * * extra version information, used to show a CVS compilation */ -#define LIBXML_VERSION_EXTRA "" +#define LIBXML_VERSION_EXTRA "-GITCVE-2015-8242" /** * LIBXML_TEST_VERSION: @@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(20902); +#define LIBXML_TEST_VERSION xmlCheckVersion(20903); #ifndef VMS #if 0 @@ -435,7 +435,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); */ #ifndef LIBXML_ATTR_ALLOC_SIZE -# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) +# if (!defined(__clang__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))) # define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x))) # else # define LIBXML_ATTR_ALLOC_SIZE(x) diff --git a/reactos/include/reactos/libs/libxml/xmlversion.h.in b/reactos/include/reactos/libs/libxml/xmlversion.h.in index 00a836fb9bc..b173be9e073 100644 --- a/reactos/include/reactos/libs/libxml/xmlversion.h.in +++ b/reactos/include/reactos/libs/libxml/xmlversion.h.in @@ -435,7 +435,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); */ #ifndef LIBXML_ATTR_ALLOC_SIZE -# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) +# if (!defined(__clang__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))) # define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x))) # else # define LIBXML_ATTR_ALLOC_SIZE(x) diff --git a/reactos/lib/3rdparty/libxml2/HTMLparser.c b/reactos/lib/3rdparty/libxml2/HTMLparser.c index d329d3b5407..b7291972ef8 100644 --- a/reactos/lib/3rdparty/libxml2/HTMLparser.c +++ b/reactos/lib/3rdparty/libxml2/HTMLparser.c @@ -2948,8 +2948,9 @@ htmlParseScript(htmlParserCtxtPtr ctxt) { /** - * htmlParseCharData: + * htmlParseCharDataInternal: * @ctxt: an HTML parser context + * @readahead: optional read ahead character in ascii range * * parse a CharData section. * if we are within a CDATA section ']]>' marks an end of section. @@ -2958,12 +2959,15 @@ htmlParseScript(htmlParserCtxtPtr ctxt) { */ static void -htmlParseCharData(htmlParserCtxtPtr ctxt) { - xmlChar buf[HTML_PARSER_BIG_BUFFER_SIZE + 5]; +htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) { + xmlChar buf[HTML_PARSER_BIG_BUFFER_SIZE + 6]; int nbchar = 0; int cur, l; int chunk = 0; + if (readahead) + buf[nbchar++] = readahead; + SHRINK; cur = CUR_CHAR(l); while (((cur != '<') || (ctxt->token == '<')) && @@ -3042,6 +3046,21 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) { } } +/** + * htmlParseCharData: + * @ctxt: an HTML parser context + * + * parse a CharData section. + * if we are within a CDATA section ']]>' marks an end of section. + * + * [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) + */ + +static void +htmlParseCharData(htmlParserCtxtPtr ctxt) { + htmlParseCharDataInternal(ctxt, 0); +} + /** * htmlParseExternalID: * @ctxt: an HTML parser context @@ -3245,12 +3264,17 @@ htmlParseComment(htmlParserCtxtPtr ctxt) { ctxt->instate = state; return; } + len = 0; + buf[len] = 0; q = CUR_CHAR(ql); + if (!IS_CHAR(q)) + goto unfinished; NEXTL(ql); r = CUR_CHAR(rl); + if (!IS_CHAR(r)) + goto unfinished; NEXTL(rl); cur = CUR_CHAR(l); - len = 0; while (IS_CHAR(cur) && ((cur != '>') || (r != '-') || (q != '-'))) { @@ -3281,18 +3305,20 @@ htmlParseComment(htmlParserCtxtPtr ctxt) { } } buf[len] = 0; - if (!IS_CHAR(cur)) { - htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, - "Comment not terminated \n