Fix crash when pn53x_TgInitAsTarget() is aborted.

This commit is contained in:
Romain Tartiere 2011-03-05 21:27:10 +00:00
parent f1f31d1b4c
commit 29618b7e27

View file

@ -1416,6 +1416,10 @@ pn53x_TgInitAsTarget (nfc_device_t * pnd, pn53x_target_mode_t ptm,
if (!pn53x_transceive (pnd, abtCmd, 36 + szOptionalBytes, abtRx, &szRx)) if (!pn53x_transceive (pnd, abtCmd, 36 + szOptionalBytes, abtRx, &szRx))
return false; return false;
if (szRx == 0) {
return false; // transceive was aborted
}
// Note: the first byte is skip: // Note: the first byte is skip:
// its the "mode" byte which contains baudrate, DEP and Framing type (Mifare, active or FeliCa) datas. // its the "mode" byte which contains baudrate, DEP and Framing type (Mifare, active or FeliCa) datas.
if(pbtModeByte) { if(pbtModeByte) {