When looking up the 'latest' caps they might not be present. Report an error instead of crashing. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- tests/testutilsqemu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 164d601613..505c66b818 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -772,6 +772,12 @@ testQemuInfoInitArgs(struct testQemuInfo *info) if (STREQ(info->args.capsver, "latest")) { capsfile = g_strdup(virHashLookup(info->conf->capslatest, info->args.capsarch)); + + if (!capsfile) { + fprintf(stderr, "'latest' caps for '%s' were not found\n", info->args.capsarch); + return -1; + } + stripmachinealiases = true; } else { capsfile = g_strdup_printf("%s/caps_%s.%s.xml", -- 2.31.1