summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1999-04-02 06:19:33 +0000
committerPaul Smith <psmith@gnu.org>1999-04-02 06:19:33 +0000
commit3d1cdf4106fb107757898c92e55e928d35c02af9 (patch)
treee6057e0287cb55abee0ad257f69ea16bc2a992c2 /job.c
parent7052a5715236b84ebe0b3011c4de75ce19c4ab5d (diff)
downloadgunmake-3d1cdf4106fb107757898c92e55e928d35c02af9.tar.gz
* Fix possible memory stomp.
* A few admin file cleanups.
Diffstat (limited to 'job.c')
-rw-r--r--job.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/job.c b/job.c
index 5999558..19f386b 100644
--- a/job.c
+++ b/job.c
@@ -2014,7 +2014,10 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
since it was most likely used to line
up the continued line with the previous one. */
if (*p == '\t')
- strcpy (p, p + 1);
+ /* Note these overlap and strcpy() is undefined for
+ overlapping objects in ANSI C. The strlen() _IS_ right,
+ since we need to copy the nul byte too. */
+ bcopy (p + 1, p, strlen(p));
if (instring)
goto string_char;