mirror of
https://github.com/jarun/nnn.git
synced 2025-01-24 17:56:41 +00:00
Fix #1110: sanitize path from plugin
This commit is contained in:
parent
c470143113
commit
9972c4bdb0
|
@ -5084,7 +5084,12 @@ static void readpipe(int fd, char **path, char **lastname, char **lastdir)
|
|||
return;
|
||||
|
||||
g_buf[len] = '\0'; /* Terminate the path read */
|
||||
if (g_buf[0] == '/') {
|
||||
nextpath = g_buf;
|
||||
len = xstrlen(g_buf);
|
||||
while (--len && (g_buf[len] == '/')) /* Trim all trailing '/' */
|
||||
g_buf[len] = '\0';
|
||||
}
|
||||
} else if (op == 'l') {
|
||||
rmlistpath(); /* Remove last list mode path, if any */
|
||||
nextpath = load_input(fd, *path);
|
||||
|
|
Loading…
Reference in a new issue