aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-04-03 09:26:14 +0000
committerWerner Koch <[email protected]>2019-04-03 09:26:14 +0000
commit1f688e0d1dba4dd7a311d416d06d654ed7b4290d (patch)
tree60ebaba398154bedf54541ffc4cb5cdd5ebd4415
parentcard: Allow card selection with LIST. (diff)
downloadgnupg-1f688e0d1dba4dd7a311d416d06d654ed7b4290d.tar.gz
gnupg-1f688e0d1dba4dd7a311d416d06d654ed7b4290d.zip
gpg: Avoid endless loop if a card's serial number can't be read.
* g10/skclist.c (enum_secret_keys): Move list forward on error. -- The error is not easy to reproduce but may occur if a card is removed at the wrong time. Tested by changing the code. Signed-off-by: Werner Koch <[email protected]>
-rw-r--r--g10/skclist.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/g10/skclist.c b/g10/skclist.c
index c9c41d0d9..ebbaba254 100644
--- a/g10/skclist.c
+++ b/g10/skclist.c
@@ -423,6 +423,7 @@ enum_secret_keys (ctrl_t ctrl, void **context, PKT_public_key *sk)
if (opt.verbose)
log_info (_("error getting serial number of card: %s\n"),
gpg_strerror (err));
+ c->sl = c->sl->next;
continue;
}