[git] GnuPG - branch, master, updated. gnupg-2.1.21-21-g5c33649

by NIIBE Yutaka cvs at cvs.gnupg.org
Wed May 31 02:51:08 CEST 2017


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  5c33649782bf255af5a55f16eac5e85f059b00bf (commit)
      from  663e5ed0737465e79a9c877f18d93bddfd05a7a4 (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 5c33649782bf255af5a55f16eac5e85f059b00bf
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Wed May 31 09:49:54 2017 +0900

    scd: Handle a failure of libusb_init.
    
    * scd/ccid-driver.c (ccid_get_reader_list, ccid_dev_scan): Handle
    failure.
    
    --
    
    Reported-by: Yuriy M. Kaminskiy <yumkam at gmail.com>
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index fbbd157..1d5e8f2 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -1228,7 +1228,12 @@ ccid_get_reader_list (void)
 
   if (!initialized_usb)
     {
-      libusb_init (NULL);
+      int rc;
+      if ((rc = libusb_init (NULL)))
+        {
+          DEBUGOUT_1 ("usb_init failed: %s.\n", libusb_error_name (rc));
+          return NULL;
+        }
       initialized_usb = 1;
     }
 
@@ -1292,9 +1297,17 @@ ccid_dev_scan (int *idx_max_p, struct ccid_dev_table **t_p)
   int idx = 0;
   int err = 0;
 
+  *idx_max_p = 0;
+  *t_p = NULL;
+
   if (!initialized_usb)
     {
-      libusb_init (NULL);
+      int rc;
+      if ((rc = libusb_init (NULL)))
+        {
+          DEBUGOUT_1 ("usb_init failed: %s.\n", libusb_error_name (rc));
+          return gpg_error (GPG_ERR_NOT_FOUND);
+        }
       initialized_usb = 1;
     }
 
@@ -1373,8 +1386,6 @@ ccid_dev_scan (int *idx_max_p, struct ccid_dev_table **t_p)
 
   if (err)
     {
-      *idx_max_p = 0;
-      *t_p = NULL;
       for (i = 0; i < idx; i++)
         {
           free (ccid_dev_table[idx].ifcdesc_extra);

-----------------------------------------------------------------------

Summary of changes:
 scd/ccid-driver.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list