From 962fde3c6cc62fe60132c6c94d0aa10103a77862 Mon Sep 17 00:00:00 2001 From: baude Date: Tue, 15 May 2018 10:40:51 -0500 Subject: fix segfault for podman push When no args were provided to podman push, podman segfaults. Quick fix to avoid the condition that triggers the segf. Signed-off-by: baude Closes: #773 Approved by: mheon --- cmd/podman/push.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/podman/push.go') diff --git a/cmd/podman/push.go b/cmd/podman/push.go index 272c49e32..94af93407 100644 --- a/cmd/podman/push.go +++ b/cmd/podman/push.go @@ -84,10 +84,10 @@ func pushCmd(c *cli.Context) error { ) args := c.Args() - srcName := args[0] if len(args) == 0 || len(args) > 2 { return errors.New("podman push requires at least one image name, and optionally a second to specify a different destination name") } + srcName := args[0] switch len(args) { case 1: destName = args[0] -- cgit v1.2.3-54-g00ecf