Re: [PATCH 1/5] http: use strbufs instead of fixed buffers

2018-05-21 Thread Stefan Beller
On Mon, May 21, 2018 at 12:41 PM, Jeff King wrote: > On Mon, May 21, 2018 at 11:11:51AM -0700, Stefan Beller wrote: > >> Hi Jeff, >> >> On Fri, May 18, 2018 at 6:56 PM, Jeff King wrote: >> >> > @@ -2421,4 +2426,5 @@ void release_http_object_request(struct >> > http_object_request *freq) >> .. >>

Re: [PATCH 1/5] http: use strbufs instead of fixed buffers

2018-05-21 Thread Jeff King
On Mon, May 21, 2018 at 11:11:51AM -0700, Stefan Beller wrote: > Hi Jeff, > > On Fri, May 18, 2018 at 6:56 PM, Jeff King wrote: > > > @@ -2421,4 +2426,5 @@ void release_http_object_request(struct > > http_object_request *freq) > .. > > + strbuf_release(&freq->tmpfile); > > Do we need an

Re: [PATCH 1/5] http: use strbufs instead of fixed buffers

2018-05-21 Thread Stefan Beller
Hi Jeff, On Fri, May 18, 2018 at 6:56 PM, Jeff King wrote: > @@ -2421,4 +2426,5 @@ void release_http_object_request(struct > http_object_request *freq) .. > + strbuf_release(&freq->tmpfile); Do we need an equivalent in release_http_pack_request as well?

[PATCH 1/5] http: use strbufs instead of fixed buffers

2018-05-18 Thread Jeff King
We keep the names of incoming packs and objects in fixed PATH_MAX-size buffers, and snprintf() into them. This is unlikely to end up with truncated filenames, but it is possible (especially on systems where PATH_MAX is shorter than actual paths can be). Let's switch to using strbufs, which makes th