Skip to content

Commit

Permalink
Merge pull request containers#12079 from stweil/lgtm
Browse files Browse the repository at this point in the history
[NO NEW TESTS NEEDED] Fix off-by-one index comparision (reported by LGTM)
  • Loading branch information
openshift-merge-robot authored Oct 25, 2021
2 parents 6618d57 + d7662ed commit dbe770e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libpod/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func readKernelVersion() (string, error) {
return "", err
}
f := bytes.Fields(buf)
if len(f) < 2 {
if len(f) < 3 {
return string(bytes.TrimSpace(buf)), nil
}
return string(f[2]), nil
Expand Down

0 comments on commit dbe770e

Please sign in to comment.