fix CID # 405226

This commit is contained in:
iceman1001 2023-03-04 20:24:20 +01:00
commit b6be8d9532

View file

@ -4843,14 +4843,17 @@ static int DesfileReadFileAndPrint(DesfireContext_t *dctx,
}
}
if (resplen > 0) {
if (resplen > 0 && reclen > 0) {
size_t reccount = resplen / reclen;
PrintAndLogEx(SUCCESS, "Read %zu bytes from file 0x%02x from record %d record count %zu record length %zu", resplen, fnum, offset, reccount, reclen);
if (reccount > 1)
if (reccount > 1) {
PrintAndLogEx(SUCCESS, "Lastest record at the bottom.");
}
for (int i = 0; i < reccount; i++) {
if (i != 0)
if (i != 0) {
PrintAndLogEx(SUCCESS, "Record %zu", reccount - (i + offset + 1));
}
print_buffer_with_offset(&resp[i * reclen], reclen, offset, (i == 0));
}
} else {