aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2020-05-17 20:06:31 -0400
committerRuss Cox <rsc@swtch.com>2020-05-17 20:15:41 -0400
commit154140a22b1c697f6a3edb3e5913efded1be082a (patch)
treec151ad9ae5bb0fe82327953399230fe2b52001f9 /src/cmd
parent8cb7308f3a24249ed091c7decf22005c64099783 (diff)
downloadplan9port-154140a22b1c697f6a3edb3e5913efded1be082a.tar.gz
plan9port-154140a22b1c697f6a3edb3e5913efded1be082a.tar.bz2
plan9port-154140a22b1c697f6a3edb3e5913efded1be082a.zip
mk: replace overlapping strcpy with memmove
Found by ASAN.
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/mk/env.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/mk/env.c b/src/cmd/mk/env.c
index d7c6481d..e01aa21a 100644
--- a/src/cmd/mk/env.c
+++ b/src/cmd/mk/env.c
@@ -123,7 +123,8 @@ buildenv(Job *j, int slot)
qp = strchr(cp+1, ')');
if(qp){
*qp = 0;
- strcpy(w->s, cp+1);
+ /* strcpy, but might overlap */
+ memmove(w->s, cp+1, strlen(cp+1)+1);
l = &w->next;
w = w->next;
continue;