From a8cb02c0c1d152153beb8706c6e8737d8cbc3a2e Mon Sep 17 00:00:00 2001 From: laforge Date: Mon, 2 Jan 2006 16:50:49 +0000 Subject: fix CCID PC_to_RDR_escape (Werner Koch) git-svn-id: https://svn.gnumonks.org/trunk/librfid@1740 e0336214-984f-0b4b-a45f-81c69e1f0ede --- ccid/ccid-driver.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ccid') diff --git a/ccid/ccid-driver.c b/ccid/ccid-driver.c index 7b024b4..edca5ca 100644 --- a/ccid/ccid-driver.c +++ b/ccid/ccid-driver.c @@ -196,6 +196,7 @@ enum { enum { VENDOR_SCM = 0x04e6, VENDOR_CHERRY = 0x046a, + VENDOR_OMNIKEY= 0x076b, VENDOR_GEMPC = 0x08e6 }; @@ -1302,12 +1303,12 @@ send_escape_cmd (ccid_driver_t handle, case CCID_DRIVER_ERR_CARD_INACTIVE: case CCID_DRIVER_ERR_NO_CARD: { - if (msglen > resultmax) - rc = CCID_DRIVER_ERR_INV_VALUE; /* Response too large. */ + if (msglen < 10 || (msglen-10) > resultmax ) + rc = CCID_DRIVER_ERR_INV_VALUE; /* Invalid length of response. */ else { - memcpy (result, msg, msglen); - *resultlen = msglen; + memcpy (result, msg+10, msglen-10); + *resultlen = msglen-10; } rc = 0; } -- cgit v1.2.3