summaryrefslogtreecommitdiff
path: root/test/apiv2/10-images.at
diff options
context:
space:
mode:
authorJelle van der Waa <jvanderwaa@redhat.com>2021-09-14 22:23:01 +0200
committerJelle van der Waa <jvanderwaa@redhat.com>2021-09-15 09:14:34 +0200
commit9b04e17893dbf91326c0f68ce7627d7bb07cf515 (patch)
treed63dd1378a675d81945c628502e88f8faf866912 /test/apiv2/10-images.at
parent323fe363134ba81ed33c24d7cce85aa0c37ab59d (diff)
downloadpodman-9b04e17893dbf91326c0f68ce7627d7bb07cf515.tar.gz
podman-9b04e17893dbf91326c0f68ce7627d7bb07cf515.tar.bz2
podman-9b04e17893dbf91326c0f68ce7627d7bb07cf515.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/10-images.at')
-rw-r--r--test/apiv2/10-images.at4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/apiv2/10-images.at b/test/apiv2/10-images.at
index abc8d44b7..d3fde9f9d 100644
--- a/test/apiv2/10-images.at
+++ b/test/apiv2/10-images.at
@@ -94,6 +94,10 @@ t GET libpod/images/json?filters='garb1age}' 500 \
t GET libpod/images/json?filters='{"label":["testl' 500 \
.cause="unexpected end of JSON input"
+# Prune images - bad all input
+t POST libpod/images/prune?all='garb1age' 500 \
+ .cause="schema: error converting value for \"all\""
+
# Prune images - bad filter input
t POST images/prune?filters='garb1age}' 500 \
.cause="invalid character 'g' looking for beginning of value"