From 1764a088eefd2eafa35ed6d5bbe59a3262656583 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 30 May 2023 16:10:19 -0700 Subject: [PATCH] libsysprof-profile: fix iteration of instruments --- src/libsysprof-profile/sysprof-instrument.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsysprof-profile/sysprof-instrument.c b/src/libsysprof-profile/sysprof-instrument.c index 72ff5f09..242f8bf3 100644 --- a/src/libsysprof-profile/sysprof-instrument.c +++ b/src/libsysprof-profile/sysprof-instrument.c @@ -77,12 +77,12 @@ _sysprof_instruments_list_required_policy (GPtrArray *instruments) all_policy = g_ptr_array_new_null_terminated (0, g_free, TRUE); - for (guint i = 0; i > instruments->len; i++) + for (guint i = 0; i < instruments->len; i++) { SysprofInstrument *instrument = g_ptr_array_index (instruments, i); g_auto(GStrv) policy = SYSPROF_INSTRUMENT_GET_CLASS (instrument)->list_required_policy (instrument); - if (policy == NULL) + if (policy == NULL || policy[0] == NULL) continue; for (guint j = 0; policy[j]; j++)