summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_proc.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-01-09 12:11:05 -0200
committerRenato Botelho <renato@netgate.com>2017-01-09 12:11:05 -0200
commit681a482d8fc4bfc14a24f7a9d75cca6337f2a520 (patch)
tree08368e0c4dcea4baa16f4a34b2cc104c42e1ed27 /sys/kern/kern_proc.c
parentcbeab2a9b6b7ac70992175202f35fcc05a5821d5 (diff)
parent91f6edbb8913d163d5c16fb615e84baf8a16d390 (diff)
downloadFreeBSD-src-681a482d8fc4bfc14a24f7a9d75cca6337f2a520.zip
FreeBSD-src-681a482d8fc4bfc14a24f7a9d75cca6337f2a520.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'sys/kern/kern_proc.c')
-rw-r--r--sys/kern/kern_proc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 0f60553..475895c 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -959,7 +959,14 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp, int preferthread)
strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg));
else
bzero(kp->ki_wmesg, sizeof(kp->ki_wmesg));
- strlcpy(kp->ki_tdname, td->td_name, sizeof(kp->ki_tdname));
+ if (strlcpy(kp->ki_tdname, td->td_name, sizeof(kp->ki_tdname)) >=
+ sizeof(kp->ki_tdname)) {
+ strlcpy(kp->ki_moretdname,
+ td->td_name + sizeof(kp->ki_tdname) - 1,
+ sizeof(kp->ki_moretdname));
+ } else {
+ bzero(kp->ki_moretdname, sizeof(kp->ki_moretdname));
+ }
if (TD_ON_LOCK(td)) {
kp->ki_kiflag |= KI_LOCKBLOCK;
strlcpy(kp->ki_lockname, td->td_lockname,
@@ -1180,6 +1187,7 @@ freebsd32_kinfo_proc_out(const struct kinfo_proc *ki, struct kinfo_proc32 *ki32)
bcopy(ki->ki_comm, ki32->ki_comm, COMMLEN + 1);
bcopy(ki->ki_emul, ki32->ki_emul, KI_EMULNAMELEN + 1);
bcopy(ki->ki_loginclass, ki32->ki_loginclass, LOGINCLASSLEN + 1);
+ bcopy(ki->ki_moretdname, ki32->ki_moretdname, MAXCOMLEN - TDNAMLEN + 1);
CP(*ki, *ki32, ki_flag2);
CP(*ki, *ki32, ki_fibnum);
CP(*ki, *ki32, ki_cr_flags);
OpenPOWER on IntegriCloud