aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lash.c3
-rw-r--r--sh.c3
-rw-r--r--shell/lash.c3
3 files changed, 6 insertions, 3 deletions
diff --git a/lash.c b/lash.c
index a2969082f..cbaf16ef8 100644
--- a/lash.c
+++ b/lash.c
@@ -1023,7 +1023,8 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
1023 1023
1024 /* Make some space to hold just the backticked command */ 1024 /* Make some space to hold just the backticked command */
1025 charptr1 = charptr2 = xmalloc(1+ptr-src); 1025 charptr1 = charptr2 = xmalloc(1+ptr-src);
1026 snprintf(charptr1, 1+ptr-src, src); 1026 memcpy(charptr1, src, ptr-src);
1027 charptr1[ptr-src] = '\0';
1027 newJob = xmalloc(sizeof(struct job)); 1028 newJob = xmalloc(sizeof(struct job));
1028 /* Now parse and run the backticked command */ 1029 /* Now parse and run the backticked command */
1029 if (!parseCommand(&charptr1, newJob, &njobList, inBg) 1030 if (!parseCommand(&charptr1, newJob, &njobList, inBg)
diff --git a/sh.c b/sh.c
index a2969082f..cbaf16ef8 100644
--- a/sh.c
+++ b/sh.c
@@ -1023,7 +1023,8 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
1023 1023
1024 /* Make some space to hold just the backticked command */ 1024 /* Make some space to hold just the backticked command */
1025 charptr1 = charptr2 = xmalloc(1+ptr-src); 1025 charptr1 = charptr2 = xmalloc(1+ptr-src);
1026 snprintf(charptr1, 1+ptr-src, src); 1026 memcpy(charptr1, src, ptr-src);
1027 charptr1[ptr-src] = '\0';
1027 newJob = xmalloc(sizeof(struct job)); 1028 newJob = xmalloc(sizeof(struct job));
1028 /* Now parse and run the backticked command */ 1029 /* Now parse and run the backticked command */
1029 if (!parseCommand(&charptr1, newJob, &njobList, inBg) 1030 if (!parseCommand(&charptr1, newJob, &njobList, inBg)
diff --git a/shell/lash.c b/shell/lash.c
index a2969082f..cbaf16ef8 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -1023,7 +1023,8 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
1023 1023
1024 /* Make some space to hold just the backticked command */ 1024 /* Make some space to hold just the backticked command */
1025 charptr1 = charptr2 = xmalloc(1+ptr-src); 1025 charptr1 = charptr2 = xmalloc(1+ptr-src);
1026 snprintf(charptr1, 1+ptr-src, src); 1026 memcpy(charptr1, src, ptr-src);
1027 charptr1[ptr-src] = '\0';
1027 newJob = xmalloc(sizeof(struct job)); 1028 newJob = xmalloc(sizeof(struct job));
1028 /* Now parse and run the backticked command */ 1029 /* Now parse and run the backticked command */
1029 if (!parseCommand(&charptr1, newJob, &njobList, inBg) 1030 if (!parseCommand(&charptr1, newJob, &njobList, inBg)