From 65cdf0e3f9598e17c7cd0570ca616f51eec11725 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 3 Aug 2016 00:39:02 +0200 Subject: [PATCH] FIX: Coverity scan 1333852, Make sure (card) is not null before accessing it. --- armsrc/iso14443b.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/armsrc/iso14443b.c b/armsrc/iso14443b.c index b8f83b97..cccf0dd6 100644 --- a/armsrc/iso14443b.c +++ b/armsrc/iso14443b.c @@ -1269,12 +1269,13 @@ uint8_t iso14443b_select_card(iso14b_card_select_t *card ) return 3; // CID - if (card) card->cid = Demod.output[0]; - - uint8_t fwt = card->atqb[6]>>4; - if ( fwt < 16 ){ - uint32_t fwt_time = (302 << fwt); - iso14b_set_timeout( fwt_time); + if (card) { + card->cid = Demod.output[0]; + uint8_t fwt = card->atqb[6] >> 4; + if ( fwt < 16 ){ + uint32_t fwt_time = (302 << fwt); + iso14b_set_timeout( fwt_time); + } } // reset PCB block number pcb_blocknum = 0; -- 2.39.5