From: David Sharp <dhsharp@google.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] rev-parse: Check argc before using argv[i+1]
Date: Tue, 28 Jan 2014 14:03:20 -0800 [thread overview]
Message-ID: <CAJL_ekvepmKn6OmLYZWO==RMAbkkArAOLK1iASQG58ShKXU_4g@mail.gmail.com> (raw)
In-Reply-To: <52E828AD.2040609@kdbg.org>
On Tue, Jan 28, 2014 at 2:01 PM, Johannes Sixt <j6t@kdbg.org> wrote:
> Am 28.01.2014 22:21, schrieb David Sharp:
>> @@ -738,9 +740,12 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
>> continue;
>> }
>> if (!strcmp(arg, "--resolve-git-dir")) {
>> - const char *gitdir = resolve_gitdir(argv[i+1]);
>> + const char *gitdir = argv[++i];
>> if (!gitdir)
>> - die("not a gitdir '%s'", argv[i+1]);
>> + die("--resolve-git-dir requires an argument");
>> + gitdir = resolve_gitdir(gitdir);
>> + if (!gitdir)
>> + die("not a gitdir '%s'", argv[i]);
>> puts(gitdir);
>> continue;
>> }
>
> In this hunk, I don't see where the old code incremented i for the
> argument. Was this another bug lurking that is fixed now?
Yup. I did notice that too. Should have mentioned it in the description.
>
> -- Hannes
>
prev parent reply other threads:[~2014-01-28 22:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-27 23:44 [PATCH] rev-parse: Check argc before using argv[i+1] David Sharp
2014-01-28 19:12 ` Junio C Hamano
2014-01-28 21:20 ` David Sharp
2014-01-28 21:21 ` [PATCH v2] " David Sharp
2014-01-28 21:43 ` Junio C Hamano
2014-01-28 22:02 ` David Sharp
2014-01-28 22:01 ` Johannes Sixt
2014-01-28 22:03 ` David Sharp [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='CAJL_ekvepmKn6OmLYZWO==RMAbkkArAOLK1iASQG58ShKXU_4g@mail.gmail.com' \
--to=dhsharp@google.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
/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;
as well as URLs for NNTP newsgroup(s).