]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhfmf.c
FIX: Coverity, CID#121314, Explicit null dereferenced, in really odd occasions...
[proxmark3-svn] / client / cmdhfmf.c
index 7736b9c51acbfd370a95b799a00d57e753cb47f9..cde20d7982c86488ab51bdf9bfca6772f645198f 100644 (file)
@@ -2052,6 +2052,11 @@ int CmdHF14AMfSniff(const char *Cmd){
                                        bufsize = traceLen;\r
                                        memset(buf, 0x00, traceLen);\r
                                }\r
+                               if (bufPtr == NULL) {\r
+                                       PrintAndLog("Cannot allocate memory for trace");\r
+                                       free(buf);\r
+                                       return 2;\r
+                               }\r
                                memcpy(bufPtr, resp.d.asBytes, len);\r
                                bufPtr += len;\r
                                pckNum++;\r
Impressum, Datenschutz