From 7c110bce808179254bc401c1551150fe54f11c76 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 26 Aug 2024 15:46:51 -0400 Subject: Only search for platform sub-string when valid --- src/stasis_indexer.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/stasis_indexer.c b/src/stasis_indexer.c index 34f8ecf..374351b 100644 --- a/src/stasis_indexer.c +++ b/src/stasis_indexer.c @@ -436,8 +436,11 @@ int indexer_readmes(struct Delivery ctx[], size_t nelem) { char *arch = strlist_item(archs, a); int have_combo = 0; for (size_t i = 0; i < nelem; i++) { - if (strstr(latest[i]->system.platform[DELIVERY_PLATFORM_RELEASE], platform) && strstr(latest[i]->system.arch, arch)) { - have_combo = 1; + if (latest[i] && latest[i]->system.platform) { + if (strstr(latest[i]->system.platform[DELIVERY_PLATFORM_RELEASE], platform) && + strstr(latest[i]->system.arch, arch)) { + have_combo = 1; + } } } if (!have_combo) { @@ -513,9 +516,12 @@ int indexer_junitxml_report(struct Delivery ctx[], size_t nelem) { char *arch = strlist_item(archs, a); int have_combo = 0; for (size_t i = 0; i < nelem; i++) { - if (strstr(latest[i]->system.platform[DELIVERY_PLATFORM_RELEASE], platform) && strstr(latest[i]->system.arch, arch)) { - have_combo = 1; - break; + if (latest[i] && latest[i]->system.platform) { + if (strstr(latest[i]->system.platform[DELIVERY_PLATFORM_RELEASE], platform) && + strstr(latest[i]->system.arch, arch)) { + have_combo = 1; + break; + } } } if (!have_combo) { -- cgit