diff --git a/ChangeLog b/ChangeLog index 6e60b15a2b..f3a041a6df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-01-08 Wim Taymans + + Based on Patch by: Brian Cameron + + * ext/ladspa/search.c: (LADSPAPluginSearch): + Avoid searching (null) paths or crashing on platforms where printing a + NULL string segfaults. Fixes #567004. + 2009-01-08 Jan Schmidt * ext/resindvd/resindvdbin.c: diff --git a/ext/ladspa/search.c b/ext/ladspa/search.c index 99e093a454..0b93214017 100644 --- a/ext/ladspa/search.c +++ b/ext/ladspa/search.c @@ -98,13 +98,19 @@ LADSPAPluginSearch (LADSPAPluginSearchCallbackFunction fCallbackFunction) const char *pcEnd; const char *pcLADSPAPath; const char *pcStart; + char *search_path; /* thomasvs: I'm sorry, but I'm going to add glib stuff here. * I'm appending logical values for LADSPA_PATH here */ - pcLADSPAPath = g_strdup_printf ("%s:/usr/lib/ladspa:/usr/local/lib/ladspa", - getenv ("LADSPA_PATH")); + search_path = getenv ("LADSPA_PATH"); + if (search_path) { + pcLADSPAPath = g_strdup_printf ("%s:/usr/lib/ladspa:/usr/local/lib/ladspa", + search_path); + } else { + pcLADSPAPath = g_strdup ("/usr/lib/ladspa:/usr/local/lib/ladspa"); + } if (!pcLADSPAPath) { /* fprintf(stderr, */