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;
|
continue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (proc.p_comm[0] != 0) {
|
if (proc.p_comm[0] != 0)
|
||||||
strncpy(kp->ki_comm, proc.p_comm, MAXCOMLEN);
|
strlcpy(kp->ki_comm, proc.p_comm, MAXCOMLEN);
|
||||||
kp->ki_comm[MAXCOMLEN] = 0;
|
|
||||||
}
|
|
||||||
(void)kvm_read(kd, (u_long)proc.p_sysent, (char *)&sysent,
|
(void)kvm_read(kd, (u_long)proc.p_sysent, (char *)&sysent,
|
||||||
sizeof(sysent));
|
sizeof(sysent));
|
||||||
(void)kvm_read(kd, (u_long)sysent.sv_name, (char *)&svname,
|
(void)kvm_read(kd, (u_long)sysent.sv_name, (char *)&svname,
|
||||||
|
Loading…
Reference in New Issue
Block a user