]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Fix issue 14: mandemod and lf em4x em410xread crashes the proxmark3 client app
authorksjoberg <ksjoberg@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Tue, 6 Apr 2010 13:41:37 +0000 (13:41 +0000)
committerksjoberg <ksjoberg@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Tue, 6 Apr 2010 13:41:37 +0000 (13:41 +0000)
This fix is quick-and-dirty since it only reduces the amount of stackspace allocated by changing the data type of the array to uint8_t instead of the 32 bit integers. The reduced number of bits is OK since only (at most) 2 of the available bits are used in each element.

At least array bit utilization is improved from 6.66% to 25% :)

Large structures such as these should probably be malloc()ed.

client/cmddata.c
client/cmdlfem4x.c

index d27ca18bbbf495914a3ae203cf9a2c8120ea07c8..5d012199f14867ec4adaf7ba72b741b0124db9bf 100644 (file)
@@ -561,7 +561,7 @@ int CmdManchesterDemod(const char *Cmd)
 
   /* But it does not work if compiling on WIndows: therefore we just allocate a */
   /* large array */
-  int BitStream[MAX_GRAPH_TRACE_LEN];
+  uint8_t BitStream[MAX_GRAPH_TRACE_LEN];
 
   /* Detect high and lows */
   for (i = 0; i < GraphTraceLen; i++)
index 37355ef267a0e819a535a73223494e6fbbea73bb..09bd1920f1e2e560a1d17520be7634534f21e288 100644 (file)
@@ -34,7 +34,7 @@ int CmdEM410xRead(const char *Cmd)
   int parity[4];
   char id[11];
   int retested = 0;
-  int BitStream[MAX_GRAPH_TRACE_LEN];
+  uint8_t BitStream[MAX_GRAPH_TRACE_LEN];
   high = low = 0;
 
   /* Detect high and lows and clock */
Impressum, Datenschutz