add check

This commit is contained in:
merlokk 2019-07-16 18:05:23 +03:00
parent e61a65fbe8
commit 5fd2a7613f

View file

@ -278,7 +278,10 @@ static int EMVExchangeEx(EMVCommandChannel channel, bool ActivateField, bool Lea
// COMPUTE APDU
int datalen = 0;
APDUEncodeS(&apdu, false, IncludeLe ? 0x100 : 0x00, data, &datalen);
if (APDUEncodeS(&apdu, false, IncludeLe ? 0x100 : 0x00, data, &datalen)) {
PrintAndLogEx(ERR, "APDU encoding error.");
return 201;
}
if (APDULogging)
PrintAndLogEx(SUCCESS, ">>>> %s", sprint_hex(data, datalen));