Skip to content

Commit

Permalink
address codeql scan finding
Browse files Browse the repository at this point in the history
  • Loading branch information
cheempz committed Mar 25, 2024
1 parent eccb96c commit 2cf27a6
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 2cf27a6

Please sign in to comment.