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
1 changed files with 4 additions and 8 deletions

View File

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