]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
fixed cmd malloc strlen()+1 bug
authordouniwan5788 <douniwan5788@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Tue, 5 Feb 2013 17:27:21 +0000 (17:27 +0000)
committerdouniwan5788 <douniwan5788@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Tue, 5 Feb 2013 17:27:21 +0000 (17:27 +0000)
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