diff options
| author | Werner Koch <[email protected]> | 2024-05-15 07:56:40 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2024-05-15 07:56:40 +0000 |
| commit | b36e557c5b05ba21942f385c03988f138d57dfb9 (patch) | |
| tree | 5907245f66f8e4b8922038c4f0a4a4028f0a6dce /g10/import.c | |
| parent | tpm2d: Use BYTE type to acces TPM2B object. (diff) | |
| download | gnupg-b36e557c5b05ba21942f385c03988f138d57dfb9.tar.gz gnupg-b36e557c5b05ba21942f385c03988f138d57dfb9.zip | |
gpg: Terminate key listing on output write error.
* g10/keylist.c (list_all): Handle error from list_keyblock.
(list_one): Ditto.
(locate_one): Ditto.
(list_keyblock): Detect write error, print, and return it.
(list_keyblock_direct): Return error from list_keyblock.
* g10/import.c (import_one_real): Break on listing error.
--
Test by using
gpg -k >/dev/full
GnuPG-bug-id: 6185
Diffstat (limited to 'g10/import.c')
| -rw-r--r-- | g10/import.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/g10/import.c b/g10/import.c index ff8847cb6..bbeeebdfe 100644 --- a/g10/import.c +++ b/g10/import.c @@ -2175,10 +2175,12 @@ import_one_real (ctrl_t ctrl, merge_keys_done = 1; /* Note that we do not want to show the validity because the key * has not yet imported. */ - list_keyblock_direct (ctrl, keyblock, from_sk, 0, + err = list_keyblock_direct (ctrl, keyblock, from_sk, 0, opt.fingerprint || opt.with_fingerprint, 1); es_fflush (es_stdout); no_usable_encr_subkeys_warning (keyblock); + if (err) + goto leave; } /* Write the keyblock to the output and do not actually import. */ |
