]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/proxmark3.c
fixed cmd malloc strlen()+1 bug
[proxmark3-svn] / client / proxmark3.c
index 4b898d5495dd2b58700698ff05225f364936b078..96f900c724b18b90f9bda01c83c6d89c587fefb2 100644 (file)
@@ -91,7 +91,7 @@ static void *main_loop(void *targ)
                     nl = strrchr(script_cmd_buf, '\n');
                     if (nl) *nl = '\0';
                    
-                    if ((cmd = (char*) malloc(strlen(script_cmd_buf))) != NULL)
+                    if ((cmd = (char*) malloc(strlen(script_cmd_buf) + 1)) != NULL)
                     {
                         memset(cmd, 0, strlen(script_cmd_buf));
                         strcpy(cmd, script_cmd_buf);
Impressum, Datenschutz