]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
Fixes to issue #100
authorMartin Holst Swende <martin@swende.se>
Sun, 3 May 2015 20:09:52 +0000 (22:09 +0200)
committerMartin Holst Swende <martin@swende.se>
Sun, 3 May 2015 20:09:52 +0000 (22:09 +0200)
client/cmdhf14a.c

index 200c9dcd6d9dd84431fb71ea79f9096f0d32b24b..d4285eeab5df128444ef2cc0ab59761cfb041507 100644 (file)
@@ -177,8 +177,8 @@ int CmdHF14AReader(const char *Cmd)
                        SendCommand(&c);
                        WaitForResponse(CMD_ACK,&resp);
 
-                       uint8_t version[8] = {0,0,0,0,0,0,0,0};
-                       memcpy(&version, resp.d.asBytes, resp.arg[0]);
+                       uint8_t version[10] = {0};
+                       memcpy(version, resp.d.asBytes, resp.arg[0] < sizeof(version) ? resp.arg[0] : sizeof(version));
                        uint8_t len = resp.arg[0] & 0xff;
                        switch ( len ){
                                // todo, identify "Magic UL-C tags". // they usually have a static nonce response to 0x1A command.
@@ -221,7 +221,7 @@ int CmdHF14AReader(const char *Cmd)
                SendCommand(&c);
                WaitForResponse(CMD_ACK,&resp);
                
-           memcpy(&card.ats, resp.d.asBytes, resp.arg[0]);
+           memcpy(card.ats, resp.d.asBytes, resp.arg[0]);
                card.ats_len = resp.arg[0];                             // note: ats_len includes CRC Bytes
        } 
 
Impressum, Datenschutz