From 178f9bb1429401ea30bb2d039f5bb9d9485cdfaa Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 20 Mar 2022 09:35:37 +0100 Subject: [PATCH] pcs param is sometimes NULL here --- armsrc/mifareutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/armsrc/mifareutil.c b/armsrc/mifareutil.c index ab69dc0a8..4a3832d71 100644 --- a/armsrc/mifareutil.c +++ b/armsrc/mifareutil.c @@ -117,7 +117,7 @@ uint16_t mifare_sendcmd_short(struct Crypto1State *pcs, uint8_t crypted, uint8_t if (answer_parity) *answer_parity = par[0]; - if (crypted == CRYPT_ALL) { + if (pcs && (crypted == CRYPT_ALL)) { if (len == 1) { uint16_t res = 0; res |= (crypto1_bit(pcs, 0, 0) ^ BIT(answer[0], 0)) << 0;