only copy resp if the operation was successful

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2437 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
nils 2005-07-18 21:30:30 +00:00
parent e09bdac57b
commit a1261369e2
1 changed files with 1 additions and 1 deletions

View File

@ -1233,7 +1233,7 @@ static int starcos_compute_signature(sc_card_t *card,
apdu.le = 256;
r = sc_transmit_apdu(card, &apdu);
SC_TEST_RET(card->ctx, r, "APDU transmit failed");
{
if (apdu.sw1 == 0x90 && apdu.sw2 == 0x00) {
int len = apdu.resplen > outlen ? outlen : apdu.resplen;
memcpy(out, apdu.resp, len);