summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2020-07-08 13:19:25 -0400
committerMatthew Heon <matthew.heon@pm.me>2020-07-15 10:04:42 -0400
commit9810e586fe4ec8d9325ae50a23acc0905a2454c3 (patch)
tree646c62ad13a88fc45ca7c717e7ee3d85967f7c4e /cmd/podman
parent5262c53598ea579db0487587f60f088c68dc1190 (diff)
downloadpodman-9810e586fe4ec8d9325ae50a23acc0905a2454c3.tar.gz
podman-9810e586fe4ec8d9325ae50a23acc0905a2454c3.tar.bz2
podman-9810e586fe4ec8d9325ae50a23acc0905a2454c3.zip
Fix a bug where --pids-limit was parsed incorrectly
The --pids-limit flag was using strconv.ParseInt with bad arguments, resulting in it being unable to parse standard integers (1024, for example, would produce an 'out of range' error). Change the arguments to make sense (base 10, max 32-bit) and add a test to ensure we don't regress again. Fixes #6908 Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/containers/create.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/podman/containers/create.go b/cmd/podman/containers/create.go
index cebf0fa4b..10761be33 100644
--- a/cmd/podman/containers/create.go
+++ b/cmd/podman/containers/create.go
@@ -202,7 +202,7 @@ func createInit(c *cobra.Command) error {
}
if c.Flags().Changed("pids-limit") {
val := c.Flag("pids-limit").Value.String()
- pidsLimit, err := strconv.ParseInt(val, 0, 10)
+ pidsLimit, err := strconv.ParseInt(val, 10, 32)
if err != nil {
return err
}