From 58ffacccc181dffa6117ef2305d87c77b533593d Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 19 Sep 2017 21:34:24 -0500 Subject: [PATCH] libpkgconf: fragment: check pkgconf_argv_split() return value --- libpkgconf/fragment.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libpkgconf/fragment.c b/libpkgconf/fragment.c index 73aa2d8..08a836c 100644 --- a/libpkgconf/fragment.c +++ b/libpkgconf/fragment.c @@ -612,11 +612,17 @@ pkgconf_fragment_free(pkgconf_list_t *list) void pkgconf_fragment_parse(const pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_list_t *vars, const char *value) { - int i, argc; + int i, ret, argc; char **argv; char *repstr = pkgconf_tuple_parse(client, vars, value); - pkgconf_argv_split(repstr, &argc, &argv); + ret = pkgconf_argv_split(repstr, &argc, &argv); + if (ret < 0) + { + PKGCONF_TRACE(client, "unable to parse fragment string [%s]", repstr); + free(repstr); + return; + } for (i = 0; i < argc && argv[i] != NULL; i++) pkgconf_fragment_add(client, list, argv[i]);