From 455b47d3756aed162d2d0ef7f40b549f3b5b30fe Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sat, 31 Aug 2019 10:08:29 +0200 Subject: [PATCH] FTP/TFTP: Fix directory traversal regression, reported by Aaron Esau Signed-off-by: Joachim Nilsson --- src/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.c b/src/common.c index 234d5ec..8e30772 100644 --- a/src/common.c +++ b/src/common.c @@ -92,7 +92,7 @@ char *compose_path(ctrl_t *ctrl, char *path) strlcat(rpath, name, sizeof(rpath)); } - if (!chrooted && strncmp(dir, home, strlen(home))) { + if (!chrooted && strncmp(rpath, home, strlen(home))) { DBG("Failed non-chroot dir:%s vs home:%s", dir, home); return NULL; }