summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/world.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9724bd2..911d74c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@ lilv (UNRELEASED) unstable; urgency=low
* Use correct URI for dcterms:replaces (for hiding old plugins):
"http://purl.org/dc/terms/replaces"
* Fix compilation on BSD
+ * Fix crash in wordexp when LV2_PATH is corrupt
-- David Robillard <d@drobilla.net> (UNRELEASED)
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);