summaryrefslogtreecommitdiffstats
path: root/sys/kern/imgact_elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/imgact_elf.c')
-rw-r--r--sys/kern/imgact_elf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 8cf2e24..ff18d0e 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -919,7 +919,8 @@ elf_corehdr(p, vp, cred, numsegs, hdr, hdrsize)
bzero(&psinfo, sizeof psinfo);
psinfo.pr_version = PRPSINFO_VERSION;
psinfo.pr_psinfosz = sizeof(prpsinfo_t);
- strncpy(psinfo.pr_fname, p->p_comm, MAXCOMLEN);
+ 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. */
strncpy(psinfo.pr_psargs, p->p_comm, PRARGSZ);
OpenPOWER on IntegriCloud