From: Junio C Hamano <junkio@cox.net>
To: SungHyun Nam <goweol@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-rm: fix possible segfault
Date: Thu, 08 Jun 2006 21:15:39 -0700 [thread overview]
Message-ID: <7vverbnevo.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20060609111044.451c94b1@namsh.wimo.co.kr> (SungHyun Nam's message of "Fri, 9 Jun 2006 11:10:44 +0900")
SungHyun Nam <goweol@gmail.com> writes:
> Signed-off-by: SungHyun Nam <goweol@gmail.com>
>
> ---
> builtin-rm.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/builtin-rm.c b/builtin-rm.c
> index ef2f8b5..aeda415 100644
> --- a/builtin-rm.c
> +++ b/builtin-rm.c
> @@ -83,6 +83,9 @@ int cmd_rm(int argc, const char **argv,
> }
> die(builtin_rm_usage);
> }
> + if (i >= argc)
> + usage(builtin_rm_usage);
> +
> pathspec = get_pathspec(prefix, argv + i);
>
> seen = NULL;
Thanks. The real problem is it uses pathspec even when no paths
is specified, but "git rm" without any arguments would remove
everything under the sun with the normal pathspec semantics, so
refusing to run when no paths are specified like you did makes
sense.
There is a more grave bug in git-rm (I do not use this command
myself at all, so I did not spot it earlier). I'll push out a
fix soonish.
prev parent reply other threads:[~2006-06-09 4:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-09 2:10 [PATCH] git-rm: fix possible segfault SungHyun Nam
2006-06-09 4:15 ` Junio C Hamano [this message]
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=7vverbnevo.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=goweol@gmail.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