[gnome-builder] makecache: check for proper pointer before calling g_strstrip()



commit 87ab8f6489a970538a67bbccf764f7a5b8dcaf2c
Author: Christian Hergert <chergert redhat com>
Date:   Fri Feb 24 20:29:49 2017 -0800

    makecache: check for proper pointer before calling g_strstrip()
    
    The functions that g_strstrip() calls do not take NULL, so we need to check
    for a proper pointer first.

 plugins/autotools/ide-makecache.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/plugins/autotools/ide-makecache.c b/plugins/autotools/ide-makecache.c
index 56c7df0..fec6782 100644
--- a/plugins/autotools/ide-makecache.c
+++ b/plugins/autotools/ide-makecache.c
@@ -1657,7 +1657,8 @@ ide_makecache_get_build_targets_worker (GTask        *task,
           parts = g_strsplit (line, "=", 2);
 
           g_strstrip (parts [0]);
-          g_strstrip (parts [1]);
+          if (parts[1])
+            g_strstrip (parts [1]);
 
           if (ide_str_empty0 (parts[0]) || ide_str_empty0 (parts[1]))
             continue;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]