diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2022-11-10 12:16:29 +0200 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2022-11-10 12:20:02 +0200 |
commit | 5ecd590481ef7da30067eea6a3cb45bf17b2f6ce (patch) | |
tree | 628a23ec90ee85a44f519a3934db888d69c9d051 | |
parent | 3b4a77a948c87a155b7f4cba1db752964fbe4157 (diff) | |
download | tcp-master.tar.gz |
-rw-r--r-- | server.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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) |