From c0c37097cf3ae4f7b7e4067f9ffcd9826808782c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 1 Dec 2011 01:17:25 +0000 Subject: Fix crash in wordexp when LV2_PATH is corrupt (patch from Paul Davis). git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3714 a436a847-0d15-0410-975c-d299462d15a1 --- src/world.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/world.c') diff --git a/src/world.c b/src/world.c index 0bad4c4..e291c55 100644 --- a/src/world.c +++ b/src/world.c @@ -561,7 +561,10 @@ expand(const char* path) #ifdef HAVE_WORDEXP char* ret = NULL; wordexp_t p; - wordexp(path, &p, 0); + if (wordexp(path, &p, 0)) { + LILV_ERRORF("Error expanding path `%s'\n", path); + return lilv_strdup (path); + } if (p.we_wordc == 0) { /* Literal directory path (e.g. no variables or ~) */ ret = lilv_strdup(path); -- cgit v1.2.1