git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jeff King <peff@peff.net>
Date
May 21, 2018, 19:41 UTC
Message-ID
<20180521194120.GA9742@sigill.intra.peff.net>
In-Reply-To
<CAGZ79kYZ9HSCC95qCZ4Zix1oEFLscsU1HZe64s--6KuWEz2ojg@mail.gmail.com>
On Mon, May 21, 2018 at 11:11:51AM -0700, Stefan Beller wrote:
Show 9 quoted lines
> Hi Jeff,
> 
> On Fri, May 18, 2018 at 6:56 PM, Jeff King <peff@peff.net> 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?
Yes, but isn't there one?
From the original patch:
--- a/http.c
+++ b/http.c
@@ -2082,6 +2082,7 @@ void release_http_pack_request(struct http_pack_request *preq)
                preq->packfile = NULL;
        }
        preq->slot = NULL;
+       strbuf_release(&preq->tmpfile);
        free(preq->url);
        free(preq);
 }

Or am I missing something?

-Peff
Previous: Stefan BellerNext: Stefan Beller
Message 4 of 13 in “snprintf truncation fixes”
  1. 0/5 snprintf truncation fixesJeff King, May 19, 2018
  2. 1/5 http: use strbufs instead of fixed buffersJeff King, May 19, 2018
  3. Stefan BellerMay 21, 2018
  4. Jeff KingMay 21, 2018
  5. Stefan BellerMay 21, 2018
  6. 2/5 log_write_email_headers: use strbufsJeff King, May 19, 2018
  7. 3/5 query_fsmonitor: use xsnprintf for formatting integersJeff King, May 19, 2018
  8. René ScharfeMay 19, 2018
  9. Jeff KingMay 20, 2018
  10. Junio C HamanoMay 21, 2018
  11. Ben PeartMay 21, 2018
  12. 4/5 shorten_unambiguous_ref: use xsnprintfJeff King, May 19, 2018
  13. 5/5 fmt_with_err: add a comment that truncation is OKJeff King, May 19, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.