Mfp commands (#698)
[proxmark3-svn] / client / cmdhf14a.c
index 316541884edd4c54d565e9ec1991daae210d8443..326eaf50f91316a7540d61e1702e10e06c494e4e 100644 (file)
@@ -750,6 +750,11 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
         recv = resp.d.asBytes;
         int iLen = resp.arg[0];
                
+        if(!iLen) {
+                       PrintAndLog("14aRAW ERROR: No card response.");
+            return 1;
+               }
+               
                *dataoutlen = iLen - 2;
                if (*dataoutlen < 0)
                        *dataoutlen = 0;
@@ -766,11 +771,6 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
                
                memcpy(dataout, &recv[2], *dataoutlen);
                
-        if(!iLen) {
-                       PrintAndLog("14aRAW ERROR: No card response.");
-            return 1;
-               }
-
                // CRC Check
                if (iLen == -1) {
                        PrintAndLog("14aRAW ERROR: ISO 14443A CRC error.");
Impressum, Datenschutz