Skip to content

Commit

Permalink
emrtd: Fix EF_DG2 image dumping
Browse files Browse the repository at this point in the history
  • Loading branch information
aveao committed Jan 29, 2021
1 parent e29bbcf commit 8f8263a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/cmdhfemrtd.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,8 @@ static int emrtd_dump_ef_dg2(uint8_t *file_contents, size_t file_length, const c
// Note: Doing file_length - 6 to account for the longest data we're checking.
// Checks first byte before the rest to reduce overhead
for (offset = 0; offset < file_length - 6; offset++) {
if ((file_contents[offset] == 0xFF && memcmp(jpeg_header, file_contents + offset, 4) != 0) ||
(file_contents[offset] == 0x00 && memcmp(jpeg2k_header, file_contents + offset, 6) != 0)) {
if ((file_contents[offset] == 0xFF && memcmp(jpeg_header, file_contents + offset, 4) == 0) ||
(file_contents[offset] == 0x00 && memcmp(jpeg2k_header, file_contents + offset, 6) == 0)) {
datalen = file_length - offset;
break;
}
Expand Down

0 comments on commit 8f8263a

Please sign in to comment.