]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
FIX: Coverity Scan fixes to emvcmd.c among others.
authoriceman1001 <iceman@iuse.se>
Sun, 5 Mar 2017 17:43:06 +0000 (18:43 +0100)
committericeman1001 <iceman@iuse.se>
Sun, 5 Mar 2017 17:43:06 +0000 (18:43 +0100)
FIX: emclearmem bug.

armsrc/emvcard.h
armsrc/emvcmd.c
armsrc/mifareutil.c
common/emvtags.h

index 51914993f12fbe00ddc9c63d9b550e40637913ed..cc886b5486bc14a87173c4c6c18900d26aa451c8 100644 (file)
@@ -178,7 +178,7 @@ typedef struct {
     uint8_t tag_9F34[3]; //Cardholder Verification Method (CVM) Results 
     uint8_t tag_9F35[1]; //Terminal Type
     uint8_t tag_9F36[2]; //Application Transaction Counter (ATC)
-    uint8_t tag_9F37[4]; //Unpredictable Number
+    uint8_t tag_9F37[8]; //Unpredictable Number
     uint8_t tag_9F38_len; 
     uint8_t tag_9F38[255]; //PDOL 
     uint8_t tag_9F39[1]; //Point-of-Service (POS) Entry Mode
@@ -209,7 +209,7 @@ typedef struct {
     uint8_t tag_9F63[6]; //Track 1 Bit Map for UN and ATC (PUNATCTRACK1)
     uint8_t tag_9F64[1]; //Track 1 Number of ATC Digits (NATCTRACK1)
     uint8_t tag_9F65[2]; //rack 2 Bit Map for CVC3 (PCVC3TRACK2)
-    uint8_t tag_9F66[2];   //Track 2 Bit Map for UN and ATC (PUNATCTRACK2), or VISA card type
+    uint8_t tag_9F66[4];   //Track 2 Bit Map for UN and ATC (PUNATCTRACK2), or VISA card type
     uint8_t tag_9F67[1];   //Track 2 Number of ATC Digits (NATCTRACK2)
     uint8_t tag_9F68_len; 
     uint8_t tag_9F68[252]; //Mag Stripe CVM List
index 217ded540d15b4d601c0c5d605900fb425245e2f..ed3dbdb9236a93230a8053213a0fa72250f67a31 100644 (file)
@@ -1068,7 +1068,7 @@ void EMVFuzz_RATS(uint8_t ratslen, uint8_t* RATS)
        uint8_t *receivedCmdPar = BigBuf_malloc(MAX_PARITY_SIZE);
        
        // To control where we are in the protocol
-       int order;
+       int order = 0;
 
        // We need to listen to the high-frequency, peak-detected path.
        iso14443a_setup(FPGA_HF_ISO14443A_TAGSIM_LISTEN);
index d26d71ee6e8ba8a56ef00654d3bae538bba7820e..1dd629518289cecedcdec6707256d7c6bb950fd3 100644 (file)
@@ -578,7 +578,7 @@ void emlClearMem(void) {
        memset(emCARD, 0, CARD_MEMORY_SIZE);\r
        \r
        // fill sectors trailer data\r
-       for(uint8_t b = 3; b < 256; ((b < 127) ? (b += 4) : (b += 16)))\r
+       for(uint16_t b = 3; b < 256; ((b < 127) ? (b += 4) : (b += 16)))\r
                emlSetMem((uint8_t *)trailer, b, 1);\r
 \r
        // uid\r
index 88cd42e8473620e643b31fd2a53bb36afba18ca5..beecd571645f4c76987909474480a513bc7fbe12 100644 (file)
@@ -182,7 +182,7 @@ typedef struct {
     uint8_t tag_9F34[3]; //Cardholder Verification Method (CVM) Results 
     uint8_t tag_9F35[1]; //Terminal Type
     uint8_t tag_9F36[2]; //Application Transaction Counter (ATC)
-    uint8_t tag_9F37[4]; //Unpredictable Number
+    uint8_t tag_9F37[8]; //Unpredictable Number
     uint8_t tag_9F38_len; 
     uint8_t tag_9F38[255]; //PDOL 
     uint8_t tag_9F39[1]; //Point-of-Service (POS) Entry Mode
@@ -213,7 +213,7 @@ typedef struct {
     uint8_t tag_9F63[6]; //Track 1 Bit Map for UN and ATC (PUNATCTRACK1)
     uint8_t tag_9F64[1]; //Track 1 Number of ATC Digits (NATCTRACK1)
     uint8_t tag_9F65[2]; //rack 2 Bit Map for CVC3 (PCVC3TRACK2)
-    uint8_t tag_9F66[2];   //Track 2 Bit Map for UN and ATC (PUNATCTRACK2), or VISA card type
+    uint8_t tag_9F66[4];   //Track 2 Bit Map for UN and ATC (PUNATCTRACK2), or VISA card type
     uint8_t tag_9F67[1];   //Track 2 Number of ATC Digits (NATCTRACK2)
     uint8_t tag_9F68_len; 
     uint8_t tag_9F68[252]; //Mag Stripe CVM List
Impressum, Datenschutz