From 7706fa2c922f5e02570b01f145ed474e82341042 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Fri, 20 Apr 2018 14:30:53 +0200 Subject: [PATCH] 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 --- src/op-support.c | 7 +++---- 1 file 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); }