aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine-gpgconf.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2021-11-25 10:48:11 +0000
committerWerner Koch <[email protected]>2021-11-25 10:48:11 +0000
commitb8b49c11e95fd978a8a2eed23f191d087ab056da (patch)
tree8f1478dedfaf0d34eba4343ede879b89cd4ddb1a /src/engine-gpgconf.c
parenttests: Silence libtool warning on Windows. (diff)
downloadgpgme-b8b49c11e95fd978a8a2eed23f191d087ab056da.tar.gz
gpgme-b8b49c11e95fd978a8a2eed23f191d087ab056da.zip
core: Make the gpgconf option parsing of string types more robust
* src/engine-gpgconf.c (gpgconf_parse_option): Skip the string indicator if it is not the empty string. -- Some versions of GnuPG (~2.2.28 to 2.2.33) returned a compliance indicator which should be an int but actually used string as type. Simply skipping the indicator without checking that this is the indicator does not allow to work around this type mismatch by the gpgme users.
Diffstat (limited to 'src/engine-gpgconf.c')
-rw-r--r--src/engine-gpgconf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/engine-gpgconf.c b/src/engine-gpgconf.c
index 28f91158..caf4d789 100644
--- a/src/engine-gpgconf.c
+++ b/src/engine-gpgconf.c
@@ -445,8 +445,10 @@ gpgconf_parse_option (gpgme_conf_opt_t opt,
case GPGME_CONF_PUB_KEY:
case GPGME_CONF_SEC_KEY:
case GPGME_CONF_ALIAS_LIST:
- /* Skip quote character. */
- line++;
+ /* Skip quote character. It is required by specs but
+ * technically not always needed. */
+ if (*line == '\"' && line[1])
+ line++;
err = _gpgme_decode_percent_string (line, &arg->value.string,
0, 0);