List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH] ui-patch: fix segfault when a path prefix is passed
@ 2017-01-22 22:30 normalperson
  2017-01-22 22:45 ` Jason
  0 siblings, 1 reply; 3+ messages in thread
From: normalperson @ 2017-01-22 22:30 UTC (permalink / raw)


From: Eric Wong <e at 80x24.org>

pathspec.c::parse_pathspec in git assumes the `argv' array
is terminated with a NULL entry, so do not let it iterate
past the end of the array.

Signed-off-by: Eric Wong <e at 80x24.org>
---
 ui-patch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui-patch.c b/ui-patch.c
index ec7f352..53475f7 100644
--- a/ui-patch.c
+++ b/ui-patch.c
@@ -18,7 +18,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
 	struct commit *commit;
 	struct object_id new_rev_oid, old_rev_oid;
 	char rev_range[2 * 40 + 3];
-	const char *rev_argv[] = { NULL, "--reverse", "--format=email", rev_range, "--", prefix };
+	const char *rev_argv[] = { NULL, "--reverse", "--format=email", rev_range, "--", prefix, NULL };
 	int rev_argc = ARRAY_SIZE(rev_argv);
 	char *patchname;
 
-- 
EW


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] ui-patch: fix segfault when a path prefix is passed
  2017-01-22 22:30 [PATCH] ui-patch: fix segfault when a path prefix is passed normalperson
@ 2017-01-22 22:45 ` Jason
  2017-01-23  8:38   ` lfleischer
  0 siblings, 1 reply; 3+ messages in thread
From: Jason @ 2017-01-22 22:45 UTC (permalink / raw)


Nice catch, thanks.

Merged.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] ui-patch: fix segfault when a path prefix is passed
  2017-01-22 22:45 ` Jason
@ 2017-01-23  8:38   ` lfleischer
  0 siblings, 0 replies; 3+ messages in thread
From: lfleischer @ 2017-01-23  8:38 UTC (permalink / raw)


On Sun, 22 Jan 2017 at 23:45:01, Jason A. Donenfeld wrote:
> Nice catch, thanks.
> 
> Merged.

Note that I had a similar patch submitted to the mailing list about two
months ago [1] and queued up in lf/for-jason as you told me back then.

Could you check whether the additional changes I have in my version of
the patch are worth applying on top of what we now have in master?

Regards,
Lukas

[1] https://lists.zx2c4.com/pipermail/cgit/2016-November/003431.html


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-23  8:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-22 22:30 [PATCH] ui-patch: fix segfault when a path prefix is passed normalperson
2017-01-22 22:45 ` Jason
2017-01-23  8:38   ` lfleischer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).