summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heinecke <aheinecke@intevation.de>2018-04-20 14:30:53 +0200
committerAndre Heinecke <aheinecke@intevation.de>2018-04-20 14:30:53 +0200
commit7706fa2c922f5e02570b01f145ed474e82341042 (patch)
treebab29d69acc810b0d4d3f4bd4ab7d022bd2d5eb2
parent302ec1f9aa396f2207e9a0e0b87ebee4d28d5df2 (diff)
downloadgpgme-7706fa2c922f5e02570b01f145ed474e82341042.tar.gz
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
-rw-r--r--src/op-support.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/op-support.c b/src/op-support.c
index 03f274cf..9414e612 100644
--- a/src/op-support.c
+++ b/src/op-support.c
@@ -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);
}