summaryrefslogtreecommitdiff
path: root/t/t7106-reset-sequence.sh
diff options
context:
space:
mode:
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>2011-11-19 19:42:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-11-21 03:32:09 (GMT)
commit05bab3ea283d687d7981583aa87e03279f3b1484 (patch)
tree273ffc2d10973ca1919125897ef2b6546652a9dd /t/t7106-reset-sequence.sh
parent3a81f33c526a09b3ae22b01d56c7ab921d19c382 (diff)
downloadgit-05bab3ea283d687d7981583aa87e03279f3b1484.zip
git-05bab3ea283d687d7981583aa87e03279f3b1484.tar.gz
git-05bab3ea283d687d7981583aa87e03279f3b1484.tar.bz2
config.c: Fix a static buffer overwrite bug by avoiding mkpath()
On cygwin, test number 21 of t3200-branch.sh (git branch -m q q2 without config should succeed) fails. The failure involves the functions from path.c which parcel out internal static buffers from the git_path() and mkpath() functions. In particular, the rename_ref() function calls safe_create_leading\ _directories() with a filename returned by git_path("logs/%s", ref). safe_create_leading_directories(), in turn, calls stat() on each element of the path it is given. On cygwin, this leads to a call to git_config() for each component of the path, since this test explicitly removes the config file. git_config() calls mkpath(), so on the fourth component of the path, the original buffer passed into the function is overwritten with the config filename. Note that this bug is specific to cygwin and it's schizophrenic stat() functions (see commits adbc0b6, 7faee6b and 7974843). The lack of a config file and a path with at least four elements is also important to trigger the bug. In order to fix the problem, we replace the call to mkpath() with a call to mksnpath() and provide our own buffer. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7106-reset-sequence.sh')
0 files changed, 0 insertions, 0 deletions