Use strlcpy(3) instead of strcpy(3)
This commit is contained in:
parent
bd2faad734
commit
4fc9d67654
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=282452
@ -145,7 +145,7 @@ tnchktc(void)
|
|||||||
/* p now points to beginning of last field */
|
/* p now points to beginning of last field */
|
||||||
if (p[0] != 't' || p[1] != 'c')
|
if (p[0] != 't' || p[1] != 'c')
|
||||||
return(1);
|
return(1);
|
||||||
strcpy(tcname,p+3);
|
strlcpy(tcname, p+3, 16);
|
||||||
q = tcname;
|
q = tcname;
|
||||||
while (q && *q != ':')
|
while (q && *q != ':')
|
||||||
q++;
|
q++;
|
||||||
@ -163,7 +163,7 @@ tnchktc(void)
|
|||||||
write(STDERR_FILENO, "Vgrind entry too long\n", 23);
|
write(STDERR_FILENO, "Vgrind entry too long\n", 23);
|
||||||
q[BUFSIZ - (p-tbuf)] = 0;
|
q[BUFSIZ - (p-tbuf)] = 0;
|
||||||
}
|
}
|
||||||
strcpy(p, q+1);
|
strlcpy(p, q+1, BUFSIZ - (p - holdtbuf));
|
||||||
tbuf = holdtbuf;
|
tbuf = holdtbuf;
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user