diff options
author | Jeff King <peff@peff.net> | 2015-10-04 23:45:26 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-10-05 11:06:49 -0700 |
commit | fdf729661a777d8bd598f40055d92b2df5601332 (patch) | |
tree | f550af4a1bab89529aa73accc8e08a6a43b2f3a3 /compat/precompose_utf8.h | |
parent | e2b021eb5b5ce2f4be3c10f1f8063981b1a53053 (diff) | |
download | git-fdf729661a777d8bd598f40055d92b2df5601332.tar.gz |
probe_utf8_pathname_composition: use internal strbuf
When we are initializing a .git directory, we may call
probe_utf8_pathname_composition to detect utf8 mangling. We
pass in a path buffer for it to use, and it blindly
strcpy()s into it, not knowing whether the buffer is large
enough to hold the result or not.
In practice this isn't a big deal, because the buffer we
pass in already contains "$GIT_DIR/config", and we append
only a few extra bytes to it. But we can easily do the right
thing just by calling git_path_buf ourselves. Technically
this results in a different pathname (before we appended our
utf8 characters to the "config" path, and now they get their
own files in $GIT_DIR), but that should not matter for our
purposes.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/precompose_utf8.h')
-rw-r--r-- | compat/precompose_utf8.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compat/precompose_utf8.h b/compat/precompose_utf8.h index 3b73585fc5..a94e7c4342 100644 --- a/compat/precompose_utf8.h +++ b/compat/precompose_utf8.h @@ -27,7 +27,7 @@ typedef struct { } PREC_DIR; void precompose_argv(int argc, const char **argv); -void probe_utf8_pathname_composition(char *, int); +void probe_utf8_pathname_composition(void); PREC_DIR *precompose_utf8_opendir(const char *dirname); struct dirent_prec_psx *precompose_utf8_readdir(PREC_DIR *dirp); |