author | Jeff King <peff@peff.net> | |
Sat, 12 Jan 2008 09:04:32 +0000 (04:04 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 12 Jan 2008 19:10:09 +0000 (11:10 -0800) | ||
commit | a8db80c22494396a81d2b4b7f4082c369fc0f78d | |
tree | a1c42f69d955bb552c87a4307c9c41e426c921bf | tree | snapshot |
parent | 98fa5b68512b9d02d8d47e726bfaec4d33598246 | commit | diff |
git-clean: fix off-by-one memory access when given no arguments
The "seen" variable is used by match_pathspec, and must have
as many elements as there are in the given pathspec. We
create the pathspec either from the command line arguments
_or_ from just the current prefix.
Thus allocating "seen" based upon just argc is wrong, since
if argc == 0, then we still have one pathspec, the prefix,
but we don't allocate any space in "seen".
Signed-off-by: Jeff King <peff@peff.net>
Tested-by: İsmail Dönmez <ismail@pardus.org.tr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The "seen" variable is used by match_pathspec, and must have
as many elements as there are in the given pathspec. We
create the pathspec either from the command line arguments
_or_ from just the current prefix.
Thus allocating "seen" based upon just argc is wrong, since
if argc == 0, then we still have one pathspec, the prefix,
but we don't allocate any space in "seen".
Signed-off-by: Jeff King <peff@peff.net>
Tested-by: İsmail Dönmez <ismail@pardus.org.tr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-clean.c | diff | blob | history |