diff options
author | Stefan Weil <sw@weilnetz.de> | 2021-10-24 22:44:38 +0200 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2021-11-12 11:08:25 -0500 |
commit | 955d01f5a81ffe376dd883fec118db8256fb450b (patch) | |
tree | e49c4d717e46cfb83cf7a286c41d687f3c230ca5 /libpod/info.go | |
parent | 2ff511798c44baeb7b3f6ccc413ec8eff24cfb4e (diff) | |
download | podman-955d01f5a81ffe376dd883fec118db8256fb450b.tar.gz podman-955d01f5a81ffe376dd883fec118db8256fb450b.tar.bz2 podman-955d01f5a81ffe376dd883fec118db8256fb450b.zip |
[NO NEW TESTS NEEDED] Fix off-by-one index comparision (reported by LGTM)
LGTM alert:
Off-by-one index comparison against length may lead to out-of-bounds read.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Diffstat (limited to 'libpod/info.go')
-rw-r--r-- | libpod/info.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/info.go b/libpod/info.go index 2eba4bbff..47fda0725 100644 --- a/libpod/info.go +++ b/libpod/info.go @@ -333,7 +333,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 |