Skip to content

Commit

Permalink
Verify forbidden chars inside cdata and escaped chars!
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonVides committed May 31, 2022
1 parent ef7018f commit cc1bdba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions c_src/rapidxml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2063,6 +2063,7 @@ namespace rapidxml
}

// No replacement, only copy character
check_control<control_points_pred, Flags>(src);
*dest++ = *src++;

}
Expand Down
4 changes: 4 additions & 0 deletions test/exml_properties_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ vector_2_forbidden_control_char_test() ->
vector_3_forbidden_control_char_test() ->
?assertMatch({error, _}, exml:parse(<<"<body lang='en' bad='", 16#1B, "'></body>">>)).

vector_4_forbidden_control_char_test() ->
?assertMatch({error, _},
exml:parse(<<"<message to='alice@localhost'><body>&amp;lt;body&amp;gt;", 16#1B,"&amp;lt;/body&amp;gt;</body></body>">>)).

fail_forbidden_control_char_test() ->
p("All valid xml cdata can be parsed",
?FORALL(Doc, utf8_doc_bad(),
Expand Down

0 comments on commit cc1bdba

Please sign in to comment.