mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-08 08:21:04 -04:00
dlopen: improve prefix check some more
If we pass a path /usr/libevil/mycode.so, it might have a prefix of /usr/lib but we should still reject it. Do thi by checking that after the prefix match, we start a new directory.
This commit is contained in:
parent
fbbc4271a3
commit
7012594926
2 changed files with 4 additions and 4 deletions
|
|
@ -262,10 +262,10 @@ static int load_ladspa_plugin(struct plugin *impl, const char *path, const char
|
|||
while ((p = split_walk(search_dirs, ":", &len, &state))) {
|
||||
int namelen;
|
||||
|
||||
if (len >= sizeof(filename))
|
||||
if (len == 0 || len >= sizeof(filename))
|
||||
continue;
|
||||
|
||||
if (strncmp(path, p, len) == 0)
|
||||
if (strncmp(path, p, len) == 0 && path[len] == '/')
|
||||
namelen = snprintf(filename, sizeof(filename), "%s", path);
|
||||
else
|
||||
namelen = snprintf(filename, sizeof(filename), "%.*s/%s.so", (int) len, p, path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue