Browse Source

scd:openpgp: Fix a segv for cards supporting unknown curves.

* common/openpgp-oid.c (get_keyalgo_string): Do not strdup NULL.
--

GnuPG-bug-id: 5963
t5964
Werner Koch 2 months ago
parent
commit
385f484133
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
  1. 4
      common/openpgp-oid.c

4
common/openpgp-oid.c

@ -658,7 +658,7 @@ get_keyalgo_string (enum gcry_pk_algos algo,
for (i=0; i < keyalgo_strings_used; i++)
{
if (keyalgo_strings[i].algo == algo
&& keyalgo_strings[i].curve
&& keyalgo_strings[i].curve && curve
&& !strcmp (keyalgo_strings[i].curve, curve))
return keyalgo_strings[i].name;
}
@ -672,7 +672,7 @@ get_keyalgo_string (enum gcry_pk_algos algo,
else
name = xasprintf ("E_error");
nbits = 0;
curvebuf = xstrdup (curve);
curvebuf = curve? xstrdup (curve) : NULL;
}
else
{

Loading…
Cancel
Save