forked from forgejo/forgejo
Fix panic in EscapeReader (#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:
parent
931c2f40e7
commit
4b3ebda0e7
2 changed files with 10 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue