All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] git-blame: prevent argument parsing segfault
@ 2007-02-16  7:38 Tommi Kyntola
  2007-02-16  8:23 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Tommi Kyntola @ 2007-02-16  7:38 UTC (permalink / raw)
  To: git


Description:
k@samael /localhome/k/git.git/git/gitweb % git-blame --incremental
zsh: segmentation fault  git blame --incremental

The 3rd branch in builtin-blame.c should also check for lacking
arguments. Running that in top dir avoids the problem because
the 'prefix' is NULL. The --incremental is no to blame here,
it only triggers the segfault and even without that flag it goes
checking argv too far.

I didn't check the pu branch, and I'm sorry if this is a dupe.

cheers,
Tommi "Kynde" Kyntola

diff --git a/builtin-blame.c b/builtin-blame.c
index 7a5665f..6d51b1f 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -2211,6 +2211,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
                 }
                 else {
                         /* (3) */
+                       if (argc <= i)
+                               usage(blame_usage);
                         path = add_prefix(prefix, argv[i]);
                         if (i + 1 == argc - 1) {
                                 final_commit_name = argv[i + 1];

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

* Re: [PATCH] git-blame: prevent argument parsing segfault
  2007-02-16  7:38 [PATCH] git-blame: prevent argument parsing segfault Tommi Kyntola
@ 2007-02-16  8:23 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2007-02-16  8:23 UTC (permalink / raw)
  To: tommi.kyntola; +Cc: git

Thanks.  Sign-off?

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

end of thread, other threads:[~2007-02-16  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-16  7:38 [PATCH] git-blame: prevent argument parsing segfault Tommi Kyntola
2007-02-16  8:23 ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.