diff options
author | Antoine Pelisse <apelisse@gmail.com> | 2013-12-14 12:31:16 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-16 14:06:19 -0800 |
commit | fc2b6214542a46f97d7067b2f7df530ed37737a7 (patch) | |
tree | 9cccda70e6bd31c1a33880ca18e239c2eb8f89bf /builtin | |
parent | Update draft release notes to 1.9 (diff) | |
download | tgif-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