Allocated buffer served to client and not properly truncated to number of bytes read. Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>
@@ -18,7 +18,7 @@ import (
func ServeData(ctx *context.Context, name string, reader io.Reader) error {
buf := make([]byte, 1024)
n, _ := reader.Read(buf)
- if n > 0 {
+ if n >= 0 {
buf = buf[:n]
}