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

Re: What's cooking in git.git (Apr 2014, #08; Fri, 25)

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 28, 2014, 17:48 UTC
Message-ID
<xmqqa9b5s5ui.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140425231953.GB3855@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 35 quoted lines
> On Fri, Apr 25, 2014 at 03:50:26PM -0700, Junio C Hamano wrote:
>
>> * jk/external-diff-use-argv-array (2014-04-21) 6 commits
>>   (merged to 'next' on 2014-04-22 at e6d92d7)
>>  + run_external_diff: refactor cmdline setup logic
>>  + run_external_diff: hoist common bits out of conditional
>>  + run_external_diff: drop fflush(NULL)
>>  + run_external_diff: clean up error handling
>>  + run_external_diff: use an argv_array for the environment
>>  + run_external_diff: use an argv_array for the command line
>> 
>>  Code clean-up.
>> 
>>  Will keep in 'next' for the remainder of the cycle.
>
> The first one does fix a possible stack overflow (albeit of one NULL,
> not arbitrary content, so I don't think it's exploitable). We may want
> to do:
>
> diff --git a/diff.c b/diff.c
> index 54d5308..a03744b 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -2894,7 +2894,7 @@ static void run_external_diff(const char *pgm,
>  			      int complete_rewrite,
>  			      struct diff_options *o)
>  {
> -	const char *spawn_arg[10];
> +	const char *spawn_arg[11];
>  	int retval;
>  	const char **arg = &spawn_arg[0];
>  	struct diff_queue_struct *q = &diff_queued_diff;
>
> as a fix for maint/2.0.0 in the interim. I can write a commit message
> for that if you're interested.

I think we should merge the first one (and possibly the second one, too) as-is for 2.0 instead. No change can possibly be more trivially correct than these two ;-)

Previous: Jeff KingNext: Jeff King
Message 9 of 14 in “What's cooking in git.git (Apr 2014, #08; Fri, 25)”
  1. Junio C HamanoApr 25, 2014
  2. Jeff KingApr 25, 2014
  3. Felipe ContrerasApr 26, 2014
  4. Alex DavidsonApr 26, 2014
  5. Felipe ContrerasApr 26, 2014
  6. Philip OakleyApr 26, 2014
  7. Felipe ContrerasApr 26, 2014
  8. Jeff KingApr 26, 2014
  9. Junio C HamanoApr 28, 2014
  10. Jeff KingApr 28, 2014
  11. Michael HaggertyMay 9, 2014
  12. Felipe ContrerasMay 9, 2014
  13. Philip OakleyMay 9, 2014
  14. Jeff KingMay 12, 2014

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.