mk: replace overlapping strcpy with memmove

Found by ASAN.
This commit is contained in:
Russ Cox 2020-05-17 20:06:31 -04:00
parent 8cb7308f3a
commit 154140a22b

View file

@ -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;