CHG: coverity complains about not reading the value from mifare_send_short

CHG: ubuntu 14.04 gcc4.8.4 complains about mem_avail still. Don't know why.
This commit is contained in:
iceman1001
2017-01-09 22:15:36 +01:00
parent 38a30dbf18
commit dd83c4572b
4 changed files with 97 additions and 261 deletions

View File

@@ -2222,7 +2222,7 @@ void ReaderMifare(bool first_try, uint8_t block, uint8_t keytype ) {
sync_cycles = PRNG_SEQUENCE_LENGTH; // Mifare Classic's random generator repeats every 2^16 cycles (and so do the nonces).
nt_attacked = 0;
if (MF_DBGLEVEL >= 4) Dbprintf("Mifare::Sync %08x", sync_time);
if (MF_DBGLEVEL >= 4) Dbprintf("Mifare::Sync %u", sync_time);
if (first_try) {
mf_nr_ar3 = 0;

View File

@@ -471,7 +471,11 @@ int mifare_ultra_writeblock(uint8_t blockNo, uint8_t *blockData) {
}
int mifare_classic_halt_ex(struct Crypto1State *pcs) {
uint8_t receivedAnswer[4] = {0x00, 0x00, 0x00, 0x00};
mifare_sendcmd_short(pcs, (pcs == NULL) ? CRYPT_NONE : CRYPT_ALL, 0x50, 0x00, receivedAnswer, NULL, NULL);
uint16_t len = mifare_sendcmd_short(pcs, (pcs == NULL) ? CRYPT_NONE : CRYPT_ALL, 0x50, 0x00, receivedAnswer, NULL, NULL);
if (len != 0) {
if (MF_DBGLEVEL >= MF_DBG_EXTENDED) Dbprintf("halt warning. response len: %x", len);
return 1;
}
return 0;
}
int mifare_classic_halt(struct Crypto1State *pcs, uint32_t uid) {