components/libxml2/patches/Bug744980-2.patch
branchs11-update
changeset 4674 58329556db63
equal deleted inserted replaced
4667:d7a7a7013e6a 4674:58329556db63
       
     1 Patch origin: upstream
       
     2 Patch status: will be part of next version
       
     3 
       
     4 From 9b8512337d14c8ddf662fcb98b0135f225a1c489 Mon Sep 17 00:00:00 2001
       
     5 From: Daniel Veillard <[email protected]>
       
     6 Date: Mon, 23 Feb 2015 11:29:20 +0800
       
     7 Subject: Cleanup conditional section error handling
       
     8 
       
     9 For https://bugzilla.gnome.org/show_bug.cgi?id=744980
       
    10 
       
    11 The error handling of Conditional Section also need to be
       
    12 straightened as the structure of the document can't be
       
    13 guessed on a failure there and it's better to stop parsing
       
    14 as further errors are likely to be irrelevant.
       
    15 
       
    16 diff --git a/parser.c b/parser.c
       
    17 index bbe97eb..fe603ac 100644
       
    18 --- a/parser.c
       
    19 +++ b/parser.c
       
    20 @@ -6770,6 +6770,8 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
       
    21  	SKIP_BLANKS;
       
    22  	if (RAW != '[') {
       
    23  	    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
       
    24 +	    xmlStopParser(ctxt);
       
    25 +	    return;
       
    26  	} else {
       
    27  	    if (ctxt->input->id != id) {
       
    28  		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
       
    29 @@ -6830,6 +6832,8 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
       
    30  	SKIP_BLANKS;
       
    31  	if (RAW != '[') {
       
    32  	    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
       
    33 +	    xmlStopParser(ctxt);
       
    34 +	    return;
       
    35  	} else {
       
    36  	    if (ctxt->input->id != id) {
       
    37  		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
       
    38 @@ -6885,6 +6889,8 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
       
    39  
       
    40      } else {
       
    41  	xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID_KEYWORD, NULL);
       
    42 +	xmlStopParser(ctxt);
       
    43 +	return;
       
    44      }
       
    45  
       
    46      if (RAW == 0)
       
    47 -- 
       
    48 cgit v0.10.2
       
    49