From ce747466a9ec44b97dac96ab39c31e06ae761fde Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 9 Apr 2021 10:07:46 +0200 Subject: cgroups: force 64 bits to ParseUint [NO TESTS NEEDED] force bitsSize==64 so that the string is always parsed to a uint64 instead of using the native int size, that could be not big enough on 32 bits arches. Closes: https://github.com/containers/podman/issues/9979 Signed-off-by: Giuseppe Scrivano --- pkg/cgroups/cgroups.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/cgroups/cgroups.go') diff --git a/pkg/cgroups/cgroups.go b/pkg/cgroups/cgroups.go index 608e1647a..aefb5183b 100644 --- a/pkg/cgroups/cgroups.go +++ b/pkg/cgroups/cgroups.go @@ -265,7 +265,7 @@ func readFileAsUint64(path string) (uint64, error) { if v == "max" { return math.MaxUint64, nil } - ret, err := strconv.ParseUint(v, 10, 0) + ret, err := strconv.ParseUint(v, 10, 64) if err != nil { return ret, errors.Wrapf(err, "parse %s from %s", v, path) } -- cgit v1.2.3-54-g00ecf