aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/server.c b/server.c
index 6c6cdf8..664e171 100644
--- a/server.c
+++ b/server.c
@@ -54,6 +54,12 @@ recvfile (int fd)
goto clean;
}
+ if (!memchr (buf, 0, PATH_MAX))
+ {
+ warning ("filename is too long");
+ goto clean;
+ }
+
/* XXX no subdirs. */
filename = strndup (buf, PATH_MAX);
if (!filename)