* [PATCH] git-rm: fix possible segfault
@ 2006-06-09 2:10 SungHyun Nam
2006-06-09 4:15 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: SungHyun Nam @ 2006-06-09 2:10 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
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;
--
1.4.0.rc1.gfd7e
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] git-rm: fix possible segfault
2006-06-09 2:10 [PATCH] git-rm: fix possible segfault SungHyun Nam
@ 2006-06-09 4:15 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2006-06-09 4:15 UTC (permalink / raw)
To: SungHyun Nam; +Cc: git
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-09 4:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-09 2:10 [PATCH] git-rm: fix possible segfault SungHyun Nam
2006-06-09 4:15 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox