summaryrefslogtreecommitdiff
path: root/test/apiv2/20-containers.at
diff options
context:
space:
mode:
authorJelle van der Waa <jvanderwaa@redhat.com>2021-09-14 22:23:01 +0200
committerMatthew Heon <mheon@redhat.com>2021-09-16 11:00:05 -0400
commit507000a304b34850c358d75af3f6291ed444c8f6 (patch)
tree1b8ebfb4869a47dc06e3b167da9947184379a15c /test/apiv2/20-containers.at
parent702e524ff7fba48e7b4de5b6847cf0980be7bb60 (diff)
downloadpodman-507000a304b34850c358d75af3f6291ed444c8f6.tar.gz
podman-507000a304b34850c358d75af3f6291ed444c8f6.tar.bz2
podman-507000a304b34850c358d75af3f6291ed444c8f6.zip
api: handle nil pointer dereference in rest endpoints
When `?all=garbage` is passed to an API endpoint schema validation fails and err is nil. Wrapf uses err to create an error message causing a nil pointer dereference. Signed-off-by: Jelle van der Waa <jvanderwaa@redhat.com>
Diffstat (limited to 'test/apiv2/20-containers.at')
-rw-r--r--test/apiv2/20-containers.at4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index 8fdecb4bd..afff68c22 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -22,6 +22,10 @@ podman run $IMAGE true
t GET libpod/containers/json 200 length=0
+# bad all input
+t GET libpod/containers/json?all='garb1age' 500 \
+ .cause="schema: error converting value for \"all\""
+
t GET libpod/containers/json?all=true 200 \
length=1 \
.[0].Id~[0-9a-f]\\{64\\} \