Merge pull request #12079 from stweil/lgtm

[NO NEW TESTS NEEDED] Fix off-by-one index comparision (reported by LGTM)
This commit is contained in:
OpenShift Merge Robot
2021-10-25 10:58:50 +00:00
committed by GitHub

View File

@ -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