commit 154140a22b1c697f6a3edb3e5913efded1be082a from: Russ Cox date: Mon May 18 00:15:41 2020 UTC mk: replace overlapping strcpy with memmove Found by ASAN. commit - 8cb7308f3a24249ed091c7decf22005c64099783 commit + 154140a22b1c697f6a3edb3e5913efded1be082a blob - d7c6481d7bb4b7a817e17c5255af89e3f1530d1b blob + e01aa21ae991364f6560a86e282a6197685849e2 --- src/cmd/mk/env.c +++ 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;