fix(kernel xml): sanitize invalid chars before xml parse #1419
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题描述
之前有人提到 issue #989,偶尔在线上也发现无法解析 XML 的报错如下
原因分析
经测试把 XML 内容解密发现有一个 \x10 字符,查 XML1.0 文档 表示这是一个非法字符,不能在 XML 中的任何位置出现(虽然在 XML1.1 中是合法字符,但由于 XML1.1 授受度较低,并且 libxml 没有支持 XML1.1 )
解决方案