From: Junio C Hamano Date: Tue, 19 Sep 2017 00:08:30 GMT Subject: Re: [PATCH 1/2] read_info_alternates: read contents into strbuf Message-ID: In-Reply-To: <20170918155429.hgql4ngayun5nbyd@sigill.intra.peff.net> Jeff King writes: > We could also just make a NUL-terminated copy of the input > bytes and operate on that. But since all but one caller > already is passing a string, instead let's just fix that > caller to provide NUL-terminated input in the first place, > by swapping out mmap for strbuf_read_file(). > ... > Let's also drop the "len" parameter entirely from > link_alt_odb_entries(), since it's completely ignored. That > will avoid any new callers re-introducing a similar bug. Both design decisions make perfect sense to me. > sha1_file.c | 29 +++++++++-------------------- > 1 file changed, 9 insertions(+), 20 deletions(-) And diffstat also agrees that it is a good change ;-)