mirror of
https://github.com/miniflux/v2.git
synced 2025-07-22 17:18:37 +00:00
fix(reader): fix a crash introduced by d59990f1
And add a fuzzer and a testcase as well to validate that nothing breaks.
This commit is contained in:
parent
70b513b8db
commit
8bde80163d
2 changed files with 28 additions and 3 deletions
|
@ -61,9 +61,11 @@ func filterValidXMLChars(s []byte) []byte {
|
|||
if r >= utf8.RuneSelf {
|
||||
r, wid = utf8.DecodeRune(s[i:])
|
||||
}
|
||||
if r = filterValidXMLChar(r); r >= 0 {
|
||||
utf8.EncodeRune(s[j:], r)
|
||||
j += wid
|
||||
if r != utf8.RuneError {
|
||||
if r = filterValidXMLChar(r); r >= 0 {
|
||||
utf8.EncodeRune(s[j:], r)
|
||||
j += wid
|
||||
}
|
||||
}
|
||||
i += wid
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue