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

Re: [PATCH] show-branch: fix crash with long ref name

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 14, 2017, 19:35 UTC
Message-ID
<xmqqlgt88t0r.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170214172526.hzpm3d3ubd3vjnzr@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 9 quoted lines
> This fixes the problem, but I think we can simplify it quite a bit by
> using resolve_refdup(). Here's the patch series I ended up with:
>
>   [1/3]: show-branch: drop head_len variable
>   [2/3]: show-branch: store resolved head in heap buffer
>   [3/3]: show-branch: use skip_prefix to drop magic numbers
>
>  builtin/show-branch.c | 39 ++++++++++++---------------------------
>  1 file changed, 12 insertions(+), 27 deletions(-)

Yes, the whole thing is my fault ;-) and I agree with what these patches do.

The second one lacks free(head) but I think that is OK; it is something we allocate in cmd_*() and use pretty much thruout the rest of the program.

Thanks.
Previous: Jeff KingNext: Jeff King
Message 8 of 15 in “show-branch: fix crash with long ref name”
  1. show-branch: fix crash with long ref nameChristian Couder, Feb 14, 2017
  2. Jeff KingFeb 14, 2017
  3. 1/3 show-branch: drop head_len variableJeff King, Feb 14, 2017
  4. 2/3 show-branch: store resolved head in heap bufferJeff King, Feb 14, 2017
  5. 3/3 show-branch: use skip_prefix to drop magic numbersJeff King, Feb 14, 2017
  6. Pranit BauvaFeb 14, 2017
  7. Jeff KingFeb 14, 2017
  8. Junio C HamanoFeb 14, 2017
  9. Jeff KingFeb 14, 2017
  10. Christian CouderFeb 14, 2017
  11. Jeff KingFeb 15, 2017
  12. Junio C HamanoFeb 15, 2017
  13. Jeff KingFeb 15, 2017
  14. Christian CouderFeb 16, 2017
  15. Jeff KingFeb 17, 2017

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.