all repos — legit @ d5a33e9150da61d95ad3ae06f6754a6dd101124a

web frontend for git, written in go

fix buffer overflow in countlines for files greater than 32k Signed-off-by: Derek Stevens <nilix@nilfm.cc>

Derek Stevens
commit

d5a33e9150da61d95ad3ae06f6754a6dd101124a

parent

c90b2b51931423e8161dabe88c4c5c11ba204872

1 file changed, 1 insertion(+), 1 deletion(-)

jump to
M routes/template.goroutes/template.go
@@ -59,7 +59,7 @@
switch { case err == io.EOF: /* handle last line not having a newline at the end */ - if bufLen >= 1 && buf[bufLen-1] != '\n' { + if bufLen >= 1 && buf[(bufLen-1)%(32*1024)] != '\n' { count++ } return count, nil