threads / patch / 11478

patchbuiltin-reflog.c: typo ref --> argv[i], could cause segfault

Subject: [PATCH] builtin-reflog.c: typo ref --> argv[i], could cause segfault

## tl;dr

3 messages between Jan 5, 2008 and Jan 5, 2008. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Brandon Casey· Jan 5, 2008, 01:11 UTC · lore
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 builtin-reflog.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to builtin-reflog.c +1 −1
diff --git a/builtin-reflog.c b/builtin-reflog.c
index f422693..5e54989 100644
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -394,7 +394,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
 		int recno;
 
 		if (!spec) {
-			status |= error("Not a reflog: %s", ref);
+			status |= error("Not a reflog: %s", argv[i]);
 			continue;
 		}
 
-- 
1.5.4.rc2.1119.g6fdf-dirty
Junio C Hamano· Jan 5, 2008, 01:22 UTC · re: Brandon Casey · lore

Re: [PATCH] builtin-reflog.c: typo ref --> argv[i], could cause segfault

Brandon Casey <casey@nrlssc.navy.mil> writes:
Show 17 quoted lines
> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
> ---
>  builtin-reflog.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/builtin-reflog.c b/builtin-reflog.c
> index f422693..5e54989 100644
> --- a/builtin-reflog.c
> +++ b/builtin-reflog.c
> @@ -394,7 +394,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
>  		int recno;
>  
>  		if (!spec) {
> -			status |= error("Not a reflog: %s", ref);
> +			status |= error("Not a reflog: %s", argv[i]);
>  			continue;
>  		}

Bad Brandon! Looking at 'next' while everybody is asked to work on finding and fixing bugs on 'master' while -rc freeze.

Just kidding. Thanks, the code is obviously correct, and will queue.

I am not so surprised to see bugs in relatively new code that is only in 'next', especially this one that no Porcelains already use.

Brandon Casey· Jan 5, 2008, 01:35 UTC · re: Junio C Hamano · lore

Re: [PATCH] builtin-reflog.c: typo ref --> argv[i], could cause segfault

Junio C Hamano wrote:
> Bad Brandon!  Looking at 'next' while everybody is asked to work
> on finding and fixing bugs on 'master' while -rc freeze.
No more, I promise. :)
-brandon

← back to recent threads