]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - winsrc/command.cpp
compile in OS X
[proxmark3-svn] / winsrc / command.cpp
index 5af6c709c61aff22383b470838c4c806d3580681..454fbab2417b1ddff306eb647fee98ce602ce862 100644 (file)
@@ -301,17 +301,19 @@ static void CmdEM4x50read(char *str)
        while(i < GraphTraceLen)\r
                {\r
                // measure from low to low\r
-               while(GraphBuffer[i] > low)\r
+               while((GraphBuffer[i] > low) && (i<GraphTraceLen))\r
                        ++i;\r
                start= i;\r
-               while(GraphBuffer[i] < high)\r
+               while((GraphBuffer[i] < high) && (i<GraphTraceLen))\r
                        ++i;\r
-               while(GraphBuffer[i] > low)\r
+               while((GraphBuffer[i] > low) && (i<GraphTraceLen))\r
                        ++i;\r
+               if (j>(MAX_GRAPH_TRACE_LEN/64)) {\r
+                       break;\r
+               }\r
                tmpbuff[j++]= i - start;\r
                }\r
 \r
-\r
        /* look for data start - should be 2 pairs of LW (pulses of 192,128) */\r
        start= -1;\r
        skip= 0;\r
@@ -331,7 +333,7 @@ static void CmdEM4x50read(char *str)
 \r
        /* skip over the remainder of the LW */\r
        skip += tmpbuff[i+1]+tmpbuff[i+2];\r
-       while(GraphBuffer[skip] > low)\r
+       while(skip < MAX_GRAPH_TRACE_LEN && GraphBuffer[skip] > low)\r
                ++skip;\r
        skip += 8;\r
 \r
@@ -1573,7 +1575,7 @@ static void CmdTIWrite(char *str)
        if (res == 2) c.ext3=0;\r
        if (res<2)\r
                PrintToScrollback("Please specify 2 or three hex strings, eg 0x1234 0x5678");\r
-       else \r
+       else\r
                SendCommand(&c, FALSE);\r
 }\r
 \r
Impressum, Datenschutz