libpkgconf: personality: ensure the path list is properly initialized before searching for triplets

pull/185/head
William Pitcock 2018-05-10 13:36:22 -05:00
parent c46868294f
commit 3ccc4454d1
1 changed files with 3 additions and 3 deletions

View File

@ -100,8 +100,8 @@ valid_triplet(const char *triplet)
{ {
const char *c = triplet; const char *c = triplet;
for (; c != '\0'; c++) for (; *c; c++)
if (!isalnum(*c) && *c != '-') if (!isalnum(*c) && *c != '-' && *c != '_')
return false; return false;
return true; return true;
@ -219,7 +219,7 @@ load_personality_with_path(const char *path, const char *triplet)
pkgconf_cross_personality_t * pkgconf_cross_personality_t *
pkgconf_cross_personality_find(const char *triplet) pkgconf_cross_personality_find(const char *triplet)
{ {
pkgconf_list_t plist; pkgconf_list_t plist = PKGCONF_LIST_INITIALIZER;
pkgconf_node_t *n; pkgconf_node_t *n;
pkgconf_cross_personality_t *out = NULL; pkgconf_cross_personality_t *out = NULL;