From b2bb58cc96048b2f38ec055f7413cafa50a775b8 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Wed, 4 Nov 2020 19:58:35 -0800 Subject: [PATCH] Added quotes to selfupdate path copy operation --- meshcore/agentcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshcore/agentcore.c b/meshcore/agentcore.c index 38e2d0e..cd14d72 100644 --- a/meshcore/agentcore.c +++ b/meshcore/agentcore.c @@ -5653,7 +5653,7 @@ int MeshAgent_Start(MeshAgentHostContainer *agentHost, int paramLen, char **para chmod(updateFilePath, results.st_mode); // Set the new executable to the same mode as the current one. remove(agentHost->exePath); - sprintf_s(ILibScratchPad, sizeof(ILibScratchPad), "cp %s %s", updateFilePath, agentHost->exePath); + sprintf_s(ILibScratchPad, sizeof(ILibScratchPad), "cp \"%s\" \"%s\"", updateFilePath, agentHost->exePath); if (system(ILibScratchPad)) {} ignore_result(write(STDOUT_FILENO, "SelfUpdate -> Restarting Agent...\n", 34));