author | Junio C Hamano <junkio@cox.net> | |
Wed, 13 Sep 2006 06:53:27 +0000 (23:53 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 13 Sep 2006 07:33:14 +0000 (00:33 -0700) | ||
commit | 5df1e0d05cc42aeef9bf2fce243375fb6dac2121 | |
tree | 13b3c830cc345cdc9eb54c99578380b51e26f61e | tree | snapshot |
parent | cdad8bbe92a447233133be8f9f3015c1bd7e10eb | commit | diff |
http-fetch: fix alternates handling.
Fetch over http from a repository that uses alternates to borrow
from neighbouring repositories were quite broken, apparently for
some time now.
We parse input and count bytes to allocate the new buffer, and
when we copy into that buffer we know exactly how many bytes we
want to copy from where. Using strlcpy for it was simply
stupid, and the code forgot to take it into account that strlcpy
terminated the string with NUL.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Fetch over http from a repository that uses alternates to borrow
from neighbouring repositories were quite broken, apparently for
some time now.
We parse input and count bytes to allocate the new buffer, and
when we copy into that buffer we know exactly how many bytes we
want to copy from where. Using strlcpy for it was simply
stupid, and the code forgot to take it into account that strlcpy
terminated the string with NUL.
Signed-off-by: Junio C Hamano <junkio@cox.net>
http-fetch.c | diff | blob | history |