From 09c2a802a1edc929e72c804bfc145062abe8f39e Mon Sep 17 00:00:00 2001
From: iceman1001 <iceman@iuse.se>
Date: Tue, 5 May 2015 00:31:02 +0200
Subject: [PATCH 1/1] ADD: @holimans changes.

---
 client/cmdhf14a.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/client/cmdhf14a.c b/client/cmdhf14a.c
index 15faa2bc..728cbb28 100644
--- a/client/cmdhf14a.c
+++ b/client/cmdhf14a.c
@@ -177,8 +177,8 @@ int CmdHF14AReader(const char *Cmd)
 			SendCommand(&c);
 			WaitForResponse(CMD_ACK,&resp);
 		
-			uint8_t version[8] = {0x00};
-			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
 	} 
 
-- 
2.39.5