From 154140a22b1c697f6a3edb3e5913efded1be082a Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sun, 17 May 2020 20:06:31 -0400 Subject: mk: replace overlapping strcpy with memmove Found by ASAN. --- src/cmd/mk/env.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/cmd') 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; -- cgit v1.2.3