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

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).