diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-08-26 15:46:51 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-08-26 15:48:03 -0400 |
commit | 7c110bce808179254bc401c1551150fe54f11c76 (patch) | |
tree | 2833a8fd629942271df89b9ba906517bc2a8ea7b /src | |
parent | 43020d3bbd07f6583d4385e361b974c899389b70 (diff) | |
download | stasis-7c110bce808179254bc401c1551150fe54f11c76.tar.gz |
Only search for platform sub-string when valid
Diffstat (limited to 'src')
-rw-r--r-- | src/stasis_indexer.c | 16 |
1 files changed, 11 insertions, 5 deletions
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) { |