diff options
author | Andre Heinecke <[email protected]> | 2023-11-29 23:06:08 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2023-11-29 23:06:08 +0000 |
commit | 6baccdc0c35d93253975e672bbf608750f97ab2a (patch) | |
tree | fffa471ecb3437a96ea488d72384c372b693c84a /src | |
parent | Post release updates (diff) | |
download | gpgme-6baccdc0c35d93253975e672bbf608750f97ab2a.tar.gz gpgme-6baccdc0c35d93253975e672bbf608750f97ab2a.zip |
core: percent decode filename
* src/op-support.c (_gpgme_parse_plaintext): Decode filename
as percent string.
--
From gnupg/doc/DETAILS:
If a filename is available it gets printed as the third
argument, percent-escaped as usual.
so we can use the usual percent decode function here.
GnuPG-Bug-Id: T6852
Diffstat (limited to 'src')
-rw-r--r-- | src/op-support.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/op-support.c b/src/op-support.c index 88a133be..cc410581 100644 --- a/src/op-support.c +++ b/src/op-support.c @@ -388,9 +388,12 @@ _gpgme_parse_plaintext (char *args, char **filenamep, int *r_mime) *tail = '\0'; if (filenamep && *args != '\0') { - char *filename = strdup (args); - if (!filename) - return gpg_error_from_syserror (); + gpgme_error_t err = 0; + char *filename = NULL; + + err = _gpgme_decode_percent_string (args, &filename, 0, 0); + if (err) + return err; *filenamep = filename; } |