mk: replace overlapping strcpy with memmove
Found by ASAN.
This commit is contained in:
parent
8cb7308f3a
commit
154140a22b
@ -123,7 +123,8 @@ buildenv(Job *j, int slot)
|
|||||||
qp = strchr(cp+1, ')');
|
qp = strchr(cp+1, ')');
|
||||||
if(qp){
|
if(qp){
|
||||||
*qp = 0;
|
*qp = 0;
|
||||||
strcpy(w->s, cp+1);
|
/* strcpy, but might overlap */
|
||||||
|
memmove(w->s, cp+1, strlen(cp+1)+1);
|
||||||
l = &w->next;
|
l = &w->next;
|
||||||
w = w->next;
|
w = w->next;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user