Mailing List Archive

[PATCH] g10: fix segfault when using both --card-edit and --with-keygrip flags
* g10/card-util.c (print_keygrip): Add NULL check.

Signed-off-by: Joey Pabalinas <joeypabalinas@gmail.com>
---
g10/card-util.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/g10/card-util.c b/g10/card-util.c
index 5205798b6a9ac486ff..1f2919fc2bb0091549 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -270,10 +270,12 @@ print_shax_fpr_colon (estream_t fp,
static void
print_keygrip (estream_t fp, const unsigned char *grp)
{
int i;

+ if (!fp)
+ return;
if (opt.with_keygrip)
{
tty_fprintf (fp, " keygrip ....: ");
for (i=0; i < 20 ; i++, grp++)
es_fprintf (fp, "%02X", *grp);
--
Cheers,
Joey Pabalinas


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: [PATCH] g10: fix segfault when using both --card-edit and --with-keygrip flags [ In reply to ]
Hello,

Joey Pabalinas <joeypabalinas@gmail.com> wrote:
> * g10/card-util.c (print_keygrip): Add NULL check.

Thanks for your report. Actually, we can print out the keygrip
information by using tty_fprint.

I pushed that change to both of master and 2.2 branch.
--

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: [PATCH] g10: fix segfault when using both --card-edit and --with-keygrip flags [ In reply to ]
On Tue, Nov 06, 2018 at 03:39:10PM +0900, NIIBE Yutaka wrote:
> Thanks for your report. Actually, we can print out the keygrip
> information by using tty_fprint.
>
> I pushed that change to both of master and 2.2 branch.

Yes, this fixes it on my end as well, thanks.

--
Cheers,
Joey Pabalinas