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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:00:53

Jeff King [off-list ref] writes:
quoted hunk
On Fri, Apr 25, 2014 at 03:50:26PM -0700, Junio C Hamano wrote:
quoted
* 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 ;-)

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

From: Jeff King <hidden>
Date: 2016-06-15 23:00:53

On Mon, Apr 28, 2014 at 10:48:21AM -0700, Junio C Hamano wrote:
quoted
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 ;-)
I'm fine with that. The second patch is pure clean-up and doesn't fix
anything (because the "3" in the env array is actually correct), so it
can happily wait for the next cycle.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help