1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

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>
This commit is contained in:
Werner Koch 2020-04-17 16:05:37 +02:00
parent bbb7edb880
commit 3633ca6e21
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -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)
{