XML parser failed on ]]]> termination of CDATA.

This commit is contained in:
Olof hagsand 2019-12-19 21:43:03 +01:00
parent 241ae26e55
commit ab46ce9820
2 changed files with 4 additions and 7 deletions

View file

@ -24,6 +24,7 @@
* Main example yang changed to incorporate augmented state, new revision is 2019-11-15. * Main example yang changed to incorporate augmented state, new revision is 2019-11-15.
### Corrected Bugs ### Corrected Bugs
* XML parser failed on `]]]>` termination of CDATA.
* [filter in netconf - one specific entry #100](https://github.com/clicon/clixon/issues/100) * [filter in netconf - one specific entry #100](https://github.com/clicon/clixon/issues/100)
* [xpath_tree2cbuf() changes integers into floating point representations #99](https://github.com/clicon/clixon/issues/99) * [xpath_tree2cbuf() changes integers into floating point representations #99](https://github.com/clicon/clixon/issues/99)
* [xml_parse_string() is slow for a long XML string #96](https://github.com/clicon/clixon/issues/96) * [xml_parse_string() is slow for a long XML string #96](https://github.com/clicon/clixon/issues/96)

View file

@ -94,7 +94,6 @@ ncname {namestart}{namechar}*
%s STATEA %s STATEA
%s AMPERSAND %s AMPERSAND
%s CDATA %s CDATA
%s CDATAEND
%s CMNT %s CMNT
%s STR %s STR
%s TEXTDECL %s TEXTDECL
@ -147,13 +146,10 @@ ncname {namestart}{namechar}*
<AMPERSAND>"quot;" { BEGIN(_YA->ya_lex_state); clixon_xml_parselval.string = "\""; return CHARDATA;} <AMPERSAND>"quot;" { BEGIN(_YA->ya_lex_state); clixon_xml_parselval.string = "\""; return CHARDATA;}
<CDATA>\n { clixon_xml_parselval.string = yytext;_YA->ya_linenum++; return (CHARDATA);} <CDATA>\n { clixon_xml_parselval.string = yytext;_YA->ya_linenum++; return (CHARDATA);}
<CDATA>\] { BEGIN(CDATAEND);clixon_xml_parselval.string = yytext;return (CHARDATA);} <CDATA>"]]>" { BEGIN(_YA->ya_lex_state); clixon_xml_parselval.string = yytext; return CHARDATA;}
<CDATA>\] { clixon_xml_parselval.string = yytext; return CHARDATA;}
<CDATA>[^]\n]+ { clixon_xml_parselval.string = yytext; return CHARDATA;} <CDATA>[^]\n]+ { clixon_xml_parselval.string = yytext; return CHARDATA;}
<CDATAEND>\n { clixon_xml_parselval.string = yytext;_YA->ya_linenum++; return (CHARDATA);}
<CDATAEND>"]>" { BEGIN(_YA->ya_lex_state); clixon_xml_parselval.string = yytext; return CHARDATA;}
<CDATAEND>. { BEGIN(CDATA); clixon_xml_parselval.string = yytext;return (CHARDATA);}
<CMNT>"-->" { BEGIN(START); return ECOMMENT; } <CMNT>"-->" { BEGIN(START); return ECOMMENT; }
<CMNT>. <CMNT>.
<TEXTDECL>encoding return ENC; <TEXTDECL>encoding return ENC;