nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 9972c4bdb075cfcaf25977bfc5a979bfdadf69c6
parent c47014311336b1ccd56dc53d1929ba79c6b2941c
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date:   Mon, 19 Jul 2021 03:51:32 +0530

Fix #1110: sanitize path from plugin

Diffstat:
Msrc/nnn.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/nnn.c b/src/nnn.c @@ -5084,7 +5084,12 @@ static void readpipe(int fd, char **path, char **lastname, char **lastdir) return; g_buf[len] = '\0'; /* Terminate the path read */ - nextpath = g_buf; + 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);