Fix panic in EscapeReader (#18820) (#18821)

Backport #18820

There is a potential panic due to a mistaken resetting of the length parameter when
multibyte characters go over a read boundary.

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath authored and GitHub committed 2022-02-19 23:34:32 +08:00
1 parent 458239b46d
commit fa9be55018
2 files changed
+10

No files matched your search

+1
View File
@@ -74,6 +74,7 @@ readingloop:
for err == nil {
n, err = text.Read(buf[readStart:])
bs := buf[:n+readStart]
n = len(bs)
i := 0
for i < len(bs) {