Skip to content

Commit

Permalink
Appease codeQL by explicitly checking the length (#2713)
Browse files Browse the repository at this point in the history
  • Loading branch information
dehaansa authored Feb 15, 2025
1 parent 60596bb commit 0206761
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/static/integrations/logruskit.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ func (o output) Write(data []byte) (n int, err error) {

// Protecting against a potential integer overflow as reported by GitHub CodeQL.
// The number of fields is expected to be well below this limit.
if fieldLen := len(ll.Data); fieldLen > 100000 {
return 0, fmt.Errorf("too many fields: %d", fieldLen)
if len(ll.Data) > 100000 {
return 0, fmt.Errorf("too many fields: %d", len(ll.Data))
}

vals := make([]interface{}, 0, 2*len(ll.Data)+2)
Expand Down

0 comments on commit 0206761

Please sign in to comment.