Skip to content

Commit

Permalink
fix: increase the default buffer size for scanning dpkg status files …
Browse files Browse the repository at this point in the history
…by 2 times (aquasecurity#6298)
  • Loading branch information
DmitriyLewen authored Mar 18, 2024
1 parent dd9620e commit 3177924
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/fanal/analyzer/pkg/dpkg/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ type dpkgScanner struct {
// NewScanner returns a new scanner that splits on empty lines.
func NewScanner(r io.Reader) *dpkgScanner {
s := bufio.NewScanner(r)
// Package data may exceed default buffer size
// Increase the buffer default size by 2 times
buf := make([]byte, 0, 128*1024)
s.Buffer(buf, 128*1024)

s.Split(emptyLineSplit)
return &dpkgScanner{Scanner: s}
}
Expand Down

0 comments on commit 3177924

Please sign in to comment.