From e6ea357cb72307460001a2526b31b26c5f919f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Andr=C3=A9n=20Zachrisson?= Date: Sun, 1 Nov 2015 19:19:57 +0100 Subject: [PATCH] Correct string copy when passing two arguments --- cue2pops.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cue2pops.c b/cue2pops.c index 662c606..b097366 100644 --- a/cue2pops.c +++ b/cue2pops.c @@ -395,7 +395,11 @@ int main(int argc, char **argv) if(argc == 3) { // PROGRAM.EXE INPUT.CUE if (!EvaluateArg(argv[2])) { // else,argv[2] is the output file name - strcpy(vcd_name, argv[2]); + vcd_name = strdup(argv[2]); + if (vcd_name == NULL) { + printf("Error: Failed to copy destination string\n"); + return 0; + } } }