- 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:
okir 2002-12-20 14:55:17 +00:00
parent 34d45b2210
commit 4c28f0dad8
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}