From 8ca5586d49825e3a01b7ec58d8ade4d64564d244 Mon Sep 17 00:00:00 2001 From: douniwan5788 Date: Tue, 5 Feb 2013 17:27:21 +0000 Subject: [PATCH] fixed cmd malloc strlen()+1 bug --- client/proxmark3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/proxmark3.c b/client/proxmark3.c index 4b898d54..96f900c7 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -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); -- 2.39.2