[git] GnuPG - branch, master, updated. gnupg-2.1.8-43-g6bb7206

by NIIBE Yutaka cvs at cvs.gnupg.org
Mon Sep 28 06:53:59 CEST 2015

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  6bb7206e357acfd7276a8f1334c0f0c9cc6ed100 (commit)
      from  12ff806d1b63d08cb43d131065d51353495d9346 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6bb7206e357acfd7276a8f1334c0f0c9cc6ed100
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Mon Sep 28 13:41:59 2015 +0900

    scd: Handle error correctly.
    * scd/apdu.c (apdu_connect): Initialize variables and check an error
    of apdu_get_status_internal.

diff --git a/scd/apdu.c b/scd/apdu.c
index e8797cd..1aebdd3 100644
--- a/scd/apdu.c
+++ b/scd/apdu.c
@@ -3313,8 +3313,8 @@ apdu_enum_reader (int slot, int *used)
 apdu_connect (int slot)
-  int sw;
-  unsigned int status;
+  int sw = 0;
+  unsigned int status = 0;
   if (DBG_READER)
     log_debug ("enter: apdu_connect: slot=%d\n", slot);
@@ -3338,15 +3338,15 @@ apdu_connect (int slot)
           unlock_slot (slot);
-  else
-    sw = 0;
   /* We need to call apdu_get_status_internal, so that the last-status
      machinery gets setup properly even if a card is inserted while
      scdaemon is fired up and apdu_get_status has not yet been called.
      Without that we would force a reset of the card with the next
      call to apdu_get_status.  */
-  apdu_get_status_internal (slot, 1, 1, &status, NULL);
+  if (!sw)
+    sw = apdu_get_status_internal (slot, 1, 1, &status, NULL);
   if (sw)
   else if (!(status & APDU_CARD_PRESENT))


Summary of changes:
 scd/apdu.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

The GNU Privacy Guard

More information about the Gnupg-commits mailing list