]> git.ipfire.org Git - thirdparty/git.git/commit - path.c
remove_leading_path: use a strbuf for internal storage
authorJeff King <peff@peff.net>
Thu, 24 Sep 2015 21:07:47 +0000 (17:07 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Oct 2015 18:08:05 +0000 (11:08 -0700)
commit4635768809885bb1c063bc9f9eee38e413f85f0d
tree8ae8f250cb48f657b538ed54d646b8b7eb07a974
parente9ba678175da28607d57043e1363c6252880dd7f
remove_leading_path: use a strbuf for internal storage

This function strcpy's directly into a PATH_MAX-sized
buffer. There's only one caller, which feeds the git_dir into
it, so it's not easy to trigger in practice (even if you fed
a large $GIT_DIR through the environment or .git file, it
would have to actually exist and be accessible on the
filesystem to get to this point). We can fix it by moving to
a strbuf.

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