summaryrefslogtreecommitdiffstats
path: root/scd
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-04-17 16:05:37 +0200
committerWerner Koch <wk@gnupg.org>2020-04-17 16:09:54 +0200
commit3633ca6e21f7feb97b6690025614575bb6909f8b (patch)
treed7f6889674b7c96214ffc6e84132c51767c0450f /scd
parentsm: Always allow authorityInfoAccess lookup if CRLs are also enabled. (diff)
downloadgnupg2-3633ca6e21f7feb97b6690025614575bb6909f8b.tar.xz
gnupg2-3633ca6e21f7feb97b6690025614575bb6909f8b.zip
scd: Detect missing card in "getinfo all_active_apps".
* scd/app.c (send_card_and_app_list): Detect no app case. -- This is a minor nug fix to return a better error message. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'scd')
-rw-r--r--scd/app.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/scd/app.c b/scd/app.c
index 0843ed445..761ed984c 100644
--- a/scd/app.c
+++ b/scd/app.c
@@ -2142,6 +2142,11 @@ send_card_and_app_list (ctrl_t ctrl, card_t wantcard, int with_apps)
npth_mutex_lock (&card_list_lock);
for (n=0, c = card_top; c; c = c->next)
n++;
+ if (!n)
+ {
+ err = gpg_error (GPG_ERR_CARD_NOT_PRESENT);
+ goto leave;
+ }
cardlist = xtrycalloc (n, sizeof *cardlist);
if (!cardlist)
{