- prevent buffer overflow
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@802 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
34d45b2210
commit
4c28f0dad8
|
@ -167,7 +167,7 @@ static int sc_transceive(struct sc_card *card, struct sc_apdu *apdu)
|
|||
else
|
||||
data_bytes = apdu->resplen = recvsize;
|
||||
if (recvsize > 0) {
|
||||
memcpy(apdu->resp, rbuf, recvsize);
|
||||
memcpy(apdu->resp, rbuf, data_bytes);
|
||||
if (apdu->sensitive)
|
||||
memset(rbuf, 0, recvsize);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue