[gnome-builder] flatpak: only access length field of existing array
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] flatpak: only access length field of existing array
- Date: Tue, 14 Feb 2017 20:11:24 +0000 (UTC)
commit ff29eab7ba1211dab1348aad44ec63ad50504e7e
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Feb 14 17:27:42 2017 -0200
flatpak: only access length field of existing array
It causes a segmentation fault when it fails to detect
the runtimes.
plugins/flatpak/gbp-flatpak-preferences-addin.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/plugins/flatpak/gbp-flatpak-preferences-addin.c b/plugins/flatpak/gbp-flatpak-preferences-addin.c
index 0881a25..b950c52 100644
--- a/plugins/flatpak/gbp-flatpak-preferences-addin.c
+++ b/plugins/flatpak/gbp-flatpak-preferences-addin.c
@@ -109,6 +109,9 @@ add_runtimes (GbpFlatpakPreferencesAddin *self,
NULL,
NULL);
+ if (refs == NULL)
+ return;
+
for (guint j = 0; j < refs->len; j++)
{
FlatpakRemoteRef *ref = g_ptr_array_index (refs, j);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]