summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Antoine Pelisse <apelisse@gmail.com>2013-12-14 12:31:16 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-12-16 14:06:19 -0800
commitfc2b6214542a46f97d7067b2f7df530ed37737a7 (patch)
tree9cccda70e6bd31c1a33880ca18e239c2eb8f89bf /builtin
parentUpdate draft release notes to 1.9 (diff)
downloadtgif-fc2b6214542a46f97d7067b2f7df530ed37737a7.tar.xz
Prevent buffer overflows when path is too long
Some buffers created with PATH_MAX length are not checked when being written, and can overflow if PATH_MAX is not big enough to hold the path. Replace those buffers by strbufs so that their size is automatically grown if necessary. They are created as static local variables to avoid reallocating memory on each call. Note that prefix_filename() returns this static buffer so each callers should copy or use the string immediately (this is currently true). Reported-by: Wataru Noguchi <wnoguchi.0727@gmail.com> Signed-off-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
0 files changed, 0 insertions, 0 deletions