Skip to content
Permalink
Browse files Browse the repository at this point in the history
Heap-buffer-overflow WRITE
  • Loading branch information
frankmorgner committed Jul 30, 2020
1 parent 9ffb9ba commit 6903aeb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/libopensc/pkcs15-oberthur.c
Expand Up @@ -271,11 +271,15 @@ sc_oberthur_read_file(struct sc_pkcs15_card *p15card, const char *in_path,
rv = sc_read_binary(card, 0, *out, sz, 0);
}
else {
int rec;
int offs = 0;
int rec_len = file->record_length;
size_t rec;
size_t offs = 0;
size_t rec_len = file->record_length;

for (rec = 1; ; rec++) {
if (rec > file->record_count) {
rv = 0;
break;
}
rv = sc_read_record(card, rec, *out + offs + 2, rec_len, SC_RECORD_BY_REC_NR);
if (rv == SC_ERROR_RECORD_NOT_FOUND) {
rv = 0;
Expand Down

0 comments on commit 6903aeb

Please sign in to comment.