diff options
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | 2012-05-01 13:25:24 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-05-08 09:13:00 -0700 |
commit | 49dc2cc2c97cd76435d7f1609f2c573b64efd5b6 (patch) | |
tree | 78ff8e6ba1fe613b517c72e85636f22335c9aaea /t/t0301-credential-cache.sh | |
parent | Git 1.7.6.6 (diff) | |
download | tgif-49dc2cc2c97cd76435d7f1609f2c573b64efd5b6.tar.xz |
dir: convert to strbuf
The functions read_directory_recursive() and treat_leading_path() both
use buffers sized to fit PATH_MAX characters. The latter can be made to
overrun its buffer, e.g. like this:
$ a=0123456789abcdef
$ a=$a$a$a$a$a$a$a$a
$ a=$a$a$a$a$a$a$a$a
$ a=$a$a$a$a$a$a$a$a
$ git add $a/a
Instead of trying to add a check and potentionally forgetting to address
similar cases, convert the involved functions and their helpers to use
struct strbuf. The patch is suprisingly large because the helpers
treat_path() and treat_one_path() modify the buffer as well and thus need
to be converted, too.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0301-credential-cache.sh')
0 files changed, 0 insertions, 0 deletions