exml
exml copied to clipboard
exml:unescape_cdata sometimes does not unescape cdata
Because C's exml_unescape_cdata() is being fed with arbitrary chunks of input, if an escaped character appears on the division point (in current implementation the input is divided in 20000-byte chunks) it's not recognized as an escaped character by the C code and is thus not unescaped. This can be reproduced with the following snippet:
> Input = lists:duplicate(19999, "a") ++ "&",
> binary_part(exml:unescape_cdata({xmlcdata, Input}), {19999, 5}).
<<"&">>