Code

http-fetch: fix alternates handling. v1.4.2.1
authorJunio C Hamano <junkio@cox.net>
Wed, 13 Sep 2006 06:53:27 +0000 (23:53 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 13 Sep 2006 07:54:43 +0000 (00:54 -0700)
commit883653babd8ee7ea23e6a5c392bb739348b1eb61
treedae67a63b5f2398f1aaccebd83dee3c99d6da30a
parent60a6bf5f53635005f4f68d8b8a33172309193623
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>
http-fetch.c