mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
mk: replace overlapping strcpy with memmove
Found by ASAN.
This commit is contained in:
parent
8cb7308f3a
commit
154140a22b
1 changed files with 2 additions and 1 deletions
|
@ -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 a new issue