List for cgit developers and users
 help / color / mirror / Atom feed
From: normalperson at yhbt.net (Eric Wong)
Subject: [PATCH] ui-patch: fix segfault when a path prefix is passed
Date: Sun, 22 Jan 2017 22:30:30 +0000	[thread overview]
Message-ID: <20170122223030.GA5886@starla> (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


             reply	other threads:[~2017-01-22 22:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-22 22:30 normalperson [this message]
2017-01-22 22:45 ` Jason
2017-01-23  8:38   ` lfleischer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170122223030.GA5886@starla \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).