Skip to content

Commit

Permalink
Merge pull request #71 from solarwinds/NH-66479-int-conversion
Browse files Browse the repository at this point in the history
NH-66479 address codeql scan finding
  • Loading branch information
cheempz authored Mar 27, 2024
2 parents eccb96c + 2cf27a6 commit d0efab5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/log/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"io"
"log"
"math"
"os"
"path/filepath"
"runtime"
Expand Down Expand Up @@ -95,7 +96,7 @@ func ToLogLevel(level string) (LogLevel, bool) {

// Accept integers for backward-compatibility.
if i, err := strconv.Atoi(level); err == nil {
if i < len(LevelStr) {
if i >= 0 && i <= math.MaxInt8 && i < len(LevelStr) {
lvl = LogLevel(i)
} else {
return lvl, false
Expand Down

0 comments on commit d0efab5

Please sign in to comment.