Replace a call to strncpy() with a call to strlcpy()
Submitted by: Cyrille Lefevre
This commit is contained in:
parent
dd693acf27
commit
b7e7c21adf
@ -328,10 +328,8 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
if (proc.p_comm[0] != 0) {
|
||||
strncpy(kp->ki_comm, proc.p_comm, MAXCOMLEN);
|
||||
kp->ki_comm[MAXCOMLEN] = 0;
|
||||
}
|
||||
if (proc.p_comm[0] != 0)
|
||||
strlcpy(kp->ki_comm, proc.p_comm, MAXCOMLEN);
|
||||
(void)kvm_read(kd, (u_long)proc.p_sysent, (char *)&sysent,
|
||||
sizeof(sysent));
|
||||
(void)kvm_read(kd, (u_long)sysent.sv_name, (char *)&svname,
|
||||
|
Loading…
Reference in New Issue
Block a user