diff options
author | Jeff King <peff@peff.net> | 2015-10-04 23:46:04 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-10-05 11:07:04 -0700 |
commit | 9c28390bda4bb86f48a3145417c1cb1892782c47 (patch) | |
tree | 61720ec3de74f3a84a8885f5585e91948b4d68cd /builtin/verify-commit.c | |
parent | probe_utf8_pathname_composition: use internal strbuf (diff) | |
download | tgif-9c28390bda4bb86f48a3145417c1cb1892782c47.tar.xz |
init: use strbufs to store paths
The init code predates strbufs, and uses PATH_MAX-sized
buffers along with many manual checks on intermediate sizes
(some of which make magic assumptions, such as that init
will not create a path inside .git longer than 50
characters).
We can simplify this greatly by using strbufs, which drops
some hard-to-verify strcpy calls in favor of git_path_buf.
While we're in the area, let's also convert existing calls
to git_path to the safer git_path_buf (our existing calls
were passed to pretty tame functions, and so were not a
problem, but it's easy to be consistent and safe here).
Note that we had an explicit test that "git init" rejects
long template directories. This comes from 32d1776 (init: Do
not segfault on big GIT_TEMPLATE_DIR environment variable,
2009-04-18). We can drop the test_must_fail here, as we now
accept this and need only confirm that we don't segfault,
which was the original point of the test.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/verify-commit.c')
0 files changed, 0 insertions, 0 deletions