Re: [PATCH v2 6/9] gpg-interface: do not hardcode the key string len anymore

2018-07-11 Thread Jeff King
On Wed, Jul 11, 2018 at 06:15:05PM +0200, Henning Schild wrote: > > diff --git a/gpg-interface.c b/gpg-interface.c > > index bf8d567a4c..139b0f561e 100644 > > --- a/gpg-interface.c > > +++ b/gpg-interface.c > > @@ -97,7 +97,7 @@ static void parse_gpg_output(struct signature_check > > *sigc) sigc->

Re: [PATCH v2 6/9] gpg-interface: do not hardcode the key string len anymore

2018-07-11 Thread Henning Schild
Am Wed, 11 Jul 2018 10:27:52 -0400 schrieb Jeff King : > On Wed, Jul 11, 2018 at 03:46:19PM +0200, Henning Schild wrote: > > > > I think it's worth addressing in the near term, if only because > > > this kind of off-by-one is quite subtle, and I don't want to > > > forget to deal with it. Whether

Re: [PATCH v2 6/9] gpg-interface: do not hardcode the key string len anymore

2018-07-11 Thread Jeff King
On Wed, Jul 11, 2018 at 03:46:19PM +0200, Henning Schild wrote: > > I think it's worth addressing in the near term, if only because this > > kind of off-by-one is quite subtle, and I don't want to forget to deal > > with it. Whether that happens as part of this patch, or as a cleanup > > before or

Re: [PATCH v2 6/9] gpg-interface: do not hardcode the key string len anymore

2018-07-11 Thread Henning Schild
Am Wed, 11 Jul 2018 08:34:25 -0400 schrieb Jeff King : > On Wed, Jul 11, 2018 at 10:54:59AM +0200, Henning Schild wrote: > > > > In the general case you need: > > > > > > found = *next ? next + 1 : next; > > > > > > or similar. In this case, you can actually do: > > > > > > found = next; >

Re: [PATCH v2 6/9] gpg-interface: do not hardcode the key string len anymore

2018-07-11 Thread Jeff King
On Wed, Jul 11, 2018 at 10:54:59AM +0200, Henning Schild wrote: > > In the general case you need: > > > > found = *next ? next + 1 : next; > > > > or similar. In this case, you can actually do: > > > > found = next; > > > > because we know that it's OK to search over the literal space agai

Re: [PATCH v2 6/9] gpg-interface: do not hardcode the key string len anymore

2018-07-11 Thread Henning Schild
Am Tue, 10 Jul 2018 11:49:31 -0400 schrieb Jeff King : > On Tue, Jul 10, 2018 at 10:52:28AM +0200, Henning Schild wrote: > > > gnupg does print the keyid followed by a space and the signer comes > > next. The same pattern is also used in gpgsm, but there the key > > length would be 40 instead of

Re: [PATCH v2 6/9] gpg-interface: do not hardcode the key string len anymore

2018-07-10 Thread Jeff King
On Tue, Jul 10, 2018 at 10:52:28AM +0200, Henning Schild wrote: > gnupg does print the keyid followed by a space and the signer comes > next. The same pattern is also used in gpgsm, but there the key length > would be 40 instead of 16. Instead of hardcoding the expected length, > find the first sp

[PATCH v2 6/9] gpg-interface: do not hardcode the key string len anymore

2018-07-10 Thread Henning Schild
gnupg does print the keyid followed by a space and the signer comes next. The same pattern is also used in gpgsm, but there the key length would be 40 instead of 16. Instead of hardcoding the expected length, find the first space and calculate it. Signed-off-by: Henning Schild --- gpg-interface.