From: roel@libnfc.org <roel@libnfc.org@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Date: Thu, 28 Feb 2013 16:04:21 +0000 (+0000)
Subject: douniwan5788:
X-Git-Tag: v1.0.0~130^2~13
X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/50d6e4abc154916cb4cf62f294700181bfc2abbc?hp=28fdb04fd8d62e46c36f959b373d662f1a146448

douniwan5788:
---

diff --git a/client/proxmark3.c b/client/proxmark3.c
index db37780d..5ac7cd0e 100644
--- a/client/proxmark3.c
+++ b/client/proxmark3.c
@@ -144,7 +144,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);