From 081da8afbfbd808acecc1d3e54f89b90c625ee77 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 29 Apr 2026 12:41:28 -0400 Subject: handle asprintf errors --- src/cli/stasis_indexer/helpers.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/cli/stasis_indexer/helpers.c') diff --git a/src/cli/stasis_indexer/helpers.c b/src/cli/stasis_indexer/helpers.c index 097b0ca..bf7efee 100644 --- a/src/cli/stasis_indexer/helpers.c +++ b/src/cli/stasis_indexer/helpers.c @@ -297,7 +297,10 @@ int get_files(struct StrList **out, const char *path, const char *pattern, ...) struct StrList *get_docker_images(struct Delivery *ctx, char *pattern) { char *tarball = NULL; - asprintf(&tarball, "%s*.tar*", pattern); + if (asprintf(&tarball, "%s*.tar*", pattern) < 0) { + SYSERROR("unable to allocate bytes for tarball pattern: %s", pattern); + return NULL; + } if (!tarball) { SYSERROR("Unable to allocate bytes for docker image wildcard pattern"); return NULL; -- cgit