From fa258379424c6d48538b054b8dc7c1ab5c2d4290 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 4 Sep 2019 12:27:54 +0200 Subject: [PATCH] scd: Fix Error checking in additioal app selection. * scd/app.c (select_additional_application): Return error for unknown NAME. -- ERR was only set but not used. Signed-off-by: Werner Koch --- scd/app.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scd/app.c b/scd/app.c index aa21886ea..e5ec59252 100644 --- a/scd/app.c +++ b/scd/app.c @@ -744,7 +744,8 @@ select_additional_application_internal (card_t card, apptype_t req_apptype) * reselect by maybe_switch_app after the select we just did. */ app->next = card->app; card->app = app; - log_info ("added app '%s' to the card context\n", strapptype (app->apptype)); + log_info ("added app '%s' to the card context and switched\n", + strapptype (app->apptype)); leave: if (err) @@ -766,7 +767,7 @@ select_additional_application (ctrl_t ctrl, const char *name) req_apptype = apptype_from_name (name); if (!req_apptype) - err = gpg_error (GPG_ERR_NOT_FOUND); + return gpg_error (GPG_ERR_NOT_FOUND); card = ctrl->card_ctx; if (!card)