Re: [PATCH] rev-parse: fix potential bus error with --parseopt option spec handling
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 26, 2008, 11:26 UTC
- Message-ID
- <alpine.LSU.1.00.0802261126130.17164@racer.site>
- In-Reply-To
- <1203998859-86344-1-git-send-email-jaysoffian@gmail.com>
Hi,
On Mon, 25 Feb 2008, Jay Soffian wrote:
Show 10 quoted lines
> diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
> index b9af1a5..90dbb9d 100644
> --- a/builtin-rev-parse.c
> +++ b/builtin-rev-parse.c
> @@ -315,7 +315,7 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
> s = strchr(sb.buf, ' ');
> if (!s || *sb.buf == ' ') {
> o->type = OPTION_GROUP;
> - o->help = xstrdup(skipspaces(s));
> + o->help = xstrdup(skipspaces(sb.buf));Looks obviously correct, but I would have expected a SIGSEGV, not a SIGBUS.
Ciao, Dscho