]> git.ipfire.org Git - thirdparty/git.git/commit - daemon.c
daemon: detect and reject too-long paths
authorJeff King <peff@peff.net>
Sat, 22 Oct 2016 04:59:38 +0000 (00:59 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Oct 2016 16:59:29 +0000 (09:59 -0700)
commit6bdb0083be3b42aab5dfa6bf18b447623704f7f5
tree8ce693e1356f617774d9abf28e27e7bf34a58968
parent0b65a8dbdb38962e700ee16776a3042beb489060
daemon: detect and reject too-long paths

When we are checking the path via path_ok(), we use some
fixed PATH_MAX buffers. We write into them via snprintf(),
so there's no possibility of overflow, but it does mean we
may silently truncate the path, leading to potentially
confusing errors when the partial path does not exist.

We're better off to reject the path explicitly.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
daemon.c