Re: [PATCH v2 4/5] replace snprintf with odb_pack_name()

2017-03-16 Thread Junio C Hamano
Jeff King writes: >> so that we can always use name.buf without having to do "?:" thing. > > See the next patch. :) Nice ;-) Thanks, queued the whole thing.

Re: [PATCH v2 4/5] replace snprintf with odb_pack_name()

2017-03-16 Thread Jeff King
On Thu, Mar 16, 2017 at 11:33:36AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > + struct strbuf name = STRBUF_INIT; > > int err; > > > > if (!from_stdin) { > > @@ -1402,14 +1402,13 @@ static void final(const char *final_pack_name, > > const char

Re: [PATCH v2 4/5] replace snprintf with odb_pack_name()

2017-03-16 Thread Junio C Hamano
Jeff King writes: > + struct strbuf name = STRBUF_INIT; > int err; > > if (!from_stdin) { > @@ -1402,14 +1402,13 @@ static void final(const char *final_pack_name, const > char *curr_pack_name, > int keep_fd, keep_msg_len = strlen(keep_msg); > >

Re: [PATCH v2 4/5] replace snprintf with odb_pack_name()

2017-03-16 Thread Ramsay Jones
On 16/03/17 14:27, Jeff King wrote: > In several places we write the name of the pack filename > into a fixed-size buffer using snprintf(), but do not check > the return value. As a result, a very long object directory > could cause us to quietly truncate the pack filename > (potentially

[PATCH v2 4/5] replace snprintf with odb_pack_name()

2017-03-16 Thread Jeff King
In several places we write the name of the pack filename into a fixed-size buffer using snprintf(), but do not check the return value. As a result, a very long object directory could cause us to quietly truncate the pack filename (potentially leading to a corrupted repository, as a newly written