coolkey: Do not overflow allocated buffer

This commit is contained in:
Jakub Jelen 2018-08-14 16:12:38 +02:00
parent 79c0dbaa4e
commit 5ec26573da
1 changed files with 1 additions and 1 deletions

View File

@ -1129,7 +1129,7 @@ static int coolkey_read_object(sc_card_t *card, unsigned long object_id, size_t
do {
ulong2bebytes(&params.offset[0], offset);
params.length = MIN(left, COOLKEY_MAX_CHUNK_SIZE);
len = left+2;
len = left;
r = coolkey_apdu_io(card, COOLKEY_CLASS, COOLKEY_INS_READ_OBJECT, 0, 0,
(u8 *)&params, sizeof(params), &out_ptr, &len, nonce, nonce_size);
if (r < 0) {