mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-19 23:03:55 +00:00
Don't explicitly null-terminate. The buffer we are copying into is
already zeroed, and we explicitly leave the last byte untouched. Submitted by: bde
This commit is contained in:
parent
d3ab0d02cf
commit
a75a0c55f4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=81799
|
@ -942,7 +942,6 @@ elf_corehdr(p, vp, cred, numsegs, hdr, hdrsize)
|
||||||
psinfo->pr_version = PRPSINFO_VERSION;
|
psinfo->pr_version = PRPSINFO_VERSION;
|
||||||
psinfo->pr_psinfosz = sizeof(prpsinfo_t);
|
psinfo->pr_psinfosz = sizeof(prpsinfo_t);
|
||||||
strncpy(psinfo->pr_fname, p->p_comm, sizeof(psinfo->pr_fname) - 1);
|
strncpy(psinfo->pr_fname, p->p_comm, sizeof(psinfo->pr_fname) - 1);
|
||||||
psinfo->pr_fname[sizeof(psinfo->pr_fname) - 1] = '\0';
|
|
||||||
|
|
||||||
/* XXX - We don't fill in the command line arguments properly yet. */
|
/* XXX - We don't fill in the command line arguments properly yet. */
|
||||||
strncpy(psinfo->pr_psargs, p->p_comm, PRARGSZ);
|
strncpy(psinfo->pr_psargs, p->p_comm, PRARGSZ);
|
||||||
|
|
Loading…
Reference in a new issue