summaryrefslogtreecommitdiffstats
path: root/sys/kern/imgact_elf.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-08-16 08:35:51 +0000
committerpeter <peter@FreeBSD.org>2001-08-16 08:35:51 +0000
commitb47c38449fbae4bbe7d4b07a92a9ca5b40ad5f3b (patch)
tree63dc7e166d55089e00f93021ab8803b06a8e04fa /sys/kern/imgact_elf.c
parente009d64b80d456dac772bb48005f766b8794ecc8 (diff)
downloadFreeBSD-src-b47c38449fbae4bbe7d4b07a92a9ca5b40ad5f3b.zip
FreeBSD-src-b47c38449fbae4bbe7d4b07a92a9ca5b40ad5f3b.tar.gz
Use explicit sizes for the prpsinfo command length string so that
we dont have any more unexpected changes in core dumps. This gets us back to the original core dump layout from a few days ago.
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