diff options
author | NIIBE Yutaka <[email protected]> | 2022-09-07 02:27:32 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2022-09-07 02:27:32 +0000 |
commit | 80670f60ba971145dd6792e00d31c08c10cc8159 (patch) | |
tree | fc99210f7ff5767452906761ecca10d05df1363d /src/import.c | |
parent | build: Omit -I... and -L... for standard paths in pkgconfig file (diff) | |
download | gpgme-80670f60ba971145dd6792e00d31c08c10cc8159.tar.gz gpgme-80670f60ba971145dd6792e00d31c08c10cc8159.zip |
Fix parsing import status for invalid fingerprint.
* src/import.c (parse_import): Handle invalid fingerprint case.
--
GnuPG-bug-id: 6187
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'src/import.c')
-rw-r--r-- | src/import.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/import.c b/src/import.c index cd9f960f..f46313c7 100644 --- a/src/import.c +++ b/src/import.c @@ -129,7 +129,7 @@ parse_import (char *args, gpgme_import_status_t *import_status, int problem) gpg_err_set_errno (0); nr = strtol (args, &tail, 0); - if (errno || args == tail || *tail != ' ') + if (errno || args == tail) { /* The crypto backend does not behave. */ free (import); @@ -173,12 +173,17 @@ parse_import (char *args, gpgme_import_status_t *import_status, int problem) if (tail) *tail = '\0'; - import->fpr = strdup (args); - if (!import->fpr) + if (*args) { - free (import); - return gpg_error_from_syserror (); + import->fpr = strdup (args); + if (!import->fpr) + { + free (import); + return gpg_error_from_syserror (); + } } + else + import->fpr = NULL; *import_status = import; return 0; |