]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhflegic.c
Coverity Scan 133850, need to ask @jason about this one.
[proxmark3-svn] / client / cmdhflegic.c
index 9168258122140048a1ec15156a2d4d18f302b60b..67085f8e5c02581abef45ee00c2b13c7918c5299 100644 (file)
@@ -297,7 +297,7 @@ int CmdLegicDecode(const char *Cmd) {
                        i = 8;
 
                        wrp          = data_buf[7] & 0x0F;
                        i = 8;
 
                        wrp          = data_buf[7] & 0x0F;
-                       wrc          = (data_buf[7] & 0x07) >> 4;
+                       wrc          = (data_buf[7] & 0x07) >> 4; // ICEMAN 20160802, this will always be ZERO
 
                        bool hasWRC = (wrc > 0);
                        bool hasWRP = (wrp > wrc);
 
                        bool hasWRC = (wrc > 0);
                        bool hasWRP = (wrp > wrc);
@@ -579,7 +579,10 @@ int CmdLegicCalcCrc8(const char *Cmd){
                        // peek at length of the input string so we can
                        // figure out how many elements to malloc in "data"
                        bg=en=0;
                        // peek at length of the input string so we can
                        // figure out how many elements to malloc in "data"
                        bg=en=0;
-                       param_getptr(Cmd, &bg, &en, cmdp+1);
+                       if (param_getptr(Cmd, &bg, &en, cmdp+1)) {
+                               errors = true;
+                               break;
+                       }
                        len = (en - bg + 1);
 
                        // check that user entered even number of characters
                        len = (en - bg + 1);
 
                        // check that user entered even number of characters
@@ -599,7 +602,10 @@ int CmdLegicCalcCrc8(const char *Cmd){
                                break;
                        }
                        
                                break;
                        }
                        
-                       param_gethex(Cmd, cmdp+1, data, len);
+                       if (param_gethex(Cmd, cmdp+1, data, len)) {
+                               errors = true;
+                               break;
+                       }
 
                        len >>= 1;      
                        cmdp += 2;
 
                        len >>= 1;      
                        cmdp += 2;
Impressum, Datenschutz