From 7fee7d833cda2373977993364eac349787ee7a6d Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sun, 17 Mar 2019 21:49:02 +0100 Subject: pod: fix segfault when there are no arguments to inspect Closes: https://github.com/containers/libpod/issues/2681 Signed-off-by: Giuseppe Scrivano --- cmd/podman/pod_inspect.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmd/podman') diff --git a/cmd/podman/pod_inspect.go b/cmd/podman/pod_inspect.go index 79ffe2e6f..46ac30c2a 100644 --- a/cmd/podman/pod_inspect.go +++ b/cmd/podman/pod_inspect.go @@ -44,6 +44,11 @@ func podInspectCmd(c *cliconfig.PodInspectValues) error { pod *adapter.Pod ) args := c.InputArgs + + if len(args) < 1 && !c.Latest { + return errors.Errorf("you must provide the name or id of a pod") + } + runtime, err := adapter.GetRuntime(&c.PodmanCommand) if err != nil { return errors.Wrapf(err, "could not get runtime") -- cgit v1.2.3-54-g00ecf