core: Do not modify args for ignored failures

* src/op-support.c (_gpgme_parse_failure): Ignore gpg-exit failures
before modifying args.

--
For op_decrypt_verify the status handler for both decrypt and
verify would parse the failure when the first parser ignored
the failure. This resulted in an ERR_INV_ENGINE as the first
call to parse_failure modified the args.

GnuPG-Bug-Id: T3919
This commit is contained in:
Andre Heinecke 2018-04-20 14:30:53 +02:00
parent 302ec1f9aa
commit 7706fa2c92
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C

View File

@ -414,6 +414,9 @@ _gpgme_parse_failure (char *args)
{
char *where, *which;
if (!strncmp (args, "gpg-exit", 8))
return 0;
where = strchr (args, ' ');
if (!where)
return trace_gpg_error (GPG_ERR_INV_ENGINE);
@ -425,9 +428,5 @@ _gpgme_parse_failure (char *args)
if (where)
*where = '\0';
where = args;
if (!strcmp (where, "gpg-exit"))
return 0;
return atoi (which);
}