diff --git a/internal/http/reader/reader.go b/internal/http/reader/reader.go index 19f9b95..bad8fb2 100644 --- a/internal/http/reader/reader.go +++ b/internal/http/reader/reader.go @@ -6,6 +6,7 @@ package reader // the golang standard library import ( + "fmt" "io" "bufio" ) @@ -55,6 +56,10 @@ func (r *chunkReader) Read() ([]byte, error){ return nil, err } + if len(line) > maxLineLength { + return nil, fmt.Errorf("HTTP line %d exceeded buffer size %d", len(line), maxLineLength) + } + /* (4) Trim */ line = removeTrailingSpace(line)