ADD: @holimans changes.

This commit is contained in:
iceman1001 2015-05-05 00:31:02 +02:00
commit 09c2a802a1

View file

@ -177,8 +177,8 @@ int CmdHF14AReader(const char *Cmd)
SendCommand(&c); SendCommand(&c);
WaitForResponse(CMD_ACK,&resp); WaitForResponse(CMD_ACK,&resp);
uint8_t version[8] = {0x00}; uint8_t version[10] = {0};
memcpy(&version, resp.d.asBytes, resp.arg[0]); memcpy(version, resp.d.asBytes, resp.arg[0] < sizeof(version) ? resp.arg[0] : sizeof(version));
uint8_t len = resp.arg[0] & 0xff; uint8_t len = resp.arg[0] & 0xff;
switch ( len){ switch ( len){
// todo, identify "Magic UL-C tags". // they usually have a static nonce response to 0x1A command. // todo, identify "Magic UL-C tags". // they usually have a static nonce response to 0x1A command.
@ -221,7 +221,7 @@ int CmdHF14AReader(const char *Cmd)
SendCommand(&c); SendCommand(&c);
WaitForResponse(CMD_ACK,&resp); WaitForResponse(CMD_ACK,&resp);
memcpy(&card.ats, resp.d.asBytes, resp.arg[0]); memcpy(card.ats, resp.d.asBytes, resp.arg[0]);
card.ats_len = resp.arg[0]; // note: ats_len includes CRC Bytes card.ats_len = resp.arg[0]; // note: ats_len includes CRC Bytes
} }