[Pkg-gnupg-commit] [gnupg2] 127/185: scd: Fix SEGV in CCID driver.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Mon Aug 7 11:55:28 UTC 2017
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch experimental
in repository gnupg2.
commit d8a55da715ce8447b0686f321fa43d00be34a467
Author: NIIBE Yutaka <gniibe at fsij.org>
Date: Fri Jul 21 13:26:53 2017 +0900
scd: Fix SEGV in CCID driver.
* scd/ccid-driver.c (intr_cb): Only kick the loop for removal.
(bulk_in): Don't set POWERED_OFF when interrupt transfer is enabled.
Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
---
scd/ccid-driver.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index ce6133f..9c22f51 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -1487,6 +1487,7 @@ intr_cb (struct libusb_transfer *transfer)
{
DEBUGOUT ("CCID: card removed\n");
handle->powered_off = 1;
+ scd_kick_the_loop ();
}
else
{
@@ -1501,9 +1502,8 @@ intr_cb (struct libusb_transfer *transfer)
device_removed:
DEBUGOUT ("CCID: device removed\n");
handle->powered_off = 1;
+ scd_kick_the_loop ();
}
-
- scd_kick_the_loop ();
}
static void
@@ -2043,8 +2043,11 @@ bulk_in (ccid_driver_t handle, unsigned char *buffer, size_t length,
* Possibly, it was forcibly suspended and resumed.
*/
DEBUGOUT ("CCID: card inactive/removed\n");
- handle->powered_off = 1;
- scd_kick_the_loop ();
+ if (handle->transfer == NULL)
+ {
+ handle->powered_off = 1;
+ scd_kick_the_loop ();
+ }
}
return rc;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list