From 3ccc4454d1ee498aac0eca14018fbf47ce17bea8 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 10 May 2018 13:36:22 -0500 Subject: [PATCH] libpkgconf: personality: ensure the path list is properly initialized before searching for triplets --- libpkgconf/personality.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libpkgconf/personality.c b/libpkgconf/personality.c index 78a5629..8e222b9 100644 --- a/libpkgconf/personality.c +++ b/libpkgconf/personality.c @@ -100,8 +100,8 @@ valid_triplet(const char *triplet) { const char *c = triplet; - for (; c != '\0'; c++) - if (!isalnum(*c) && *c != '-') + for (; *c; c++) + if (!isalnum(*c) && *c != '-' && *c != '_') return false; return true; @@ -219,7 +219,7 @@ load_personality_with_path(const char *path, const char *triplet) pkgconf_cross_personality_t * pkgconf_cross_personality_find(const char *triplet) { - pkgconf_list_t plist; + pkgconf_list_t plist = PKGCONF_LIST_INITIALIZER; pkgconf_node_t *n; pkgconf_cross_personality_t *out = NULL;