1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-01 22:28:02 +02:00

g10: Fix segfault on unsupported curve.

* g10/call-agent.c (learn_status_cb): Don't use NULL for strcmp.
--

With libgcrypt not supporting cv25519, gpg segfaults.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2016-01-26 11:12:33 +09:00
parent d33a34004b
commit b8bb16c6c0

View File

@ -701,14 +701,10 @@ learn_status_cb (void *opaque, const char *line)
{ {
const char *curve; const char *curve;
i = 0; for (i = 0; (curve = openpgp_enum_curves (&i));)
do
{
curve = openpgp_enum_curves (&i);
if (!strcmp (curve, line+n)) if (!strcmp (curve, line+n))
break; break;
}
while (curve != NULL);
parm->key_attr[keyno].curve = curve; parm->key_attr[keyno].curve = curve;
} }
} }