mirror of
https://github.com/opnsense/src.git
synced 2026-06-14 19:20:18 -04:00
When bcopying the program name into the ktrace header, make sure we include
the terminating zero by copying MAXCOMLEN + 1 bytes. This fixes the garbage that occasionally appeared behind the programname when it is at least MAXCOMLEN bytes long (such as communicator-4.61-bin).
This commit is contained in:
parent
faad302913
commit
85fce0e478
1 changed files with 4 additions and 4 deletions
|
|
@ -73,7 +73,7 @@ ktrgetheader(type)
|
|||
kth->ktr_type = type;
|
||||
microtime(&kth->ktr_time);
|
||||
kth->ktr_pid = p->p_pid;
|
||||
bcopy(p->p_comm, kth->ktr_comm, MAXCOMLEN);
|
||||
bcopy(p->p_comm, kth->ktr_comm, MAXCOMLEN + 1);
|
||||
return (kth);
|
||||
}
|
||||
|
||||
|
|
@ -194,9 +194,9 @@ done:
|
|||
void
|
||||
ktrpsig(vp, sig, action, mask, code)
|
||||
struct vnode *vp;
|
||||
int sig;
|
||||
int sig, code;
|
||||
sig_t action;
|
||||
int mask, code;
|
||||
sigset_t *mask;
|
||||
{
|
||||
struct ktr_header *kth;
|
||||
struct ktr_psig kp;
|
||||
|
|
@ -206,7 +206,7 @@ ktrpsig(vp, sig, action, mask, code)
|
|||
kth = ktrgetheader(KTR_PSIG);
|
||||
kp.signo = (char)sig;
|
||||
kp.action = action;
|
||||
kp.mask = mask;
|
||||
kp.mask = *mask;
|
||||
kp.code = code;
|
||||
kth->ktr_buf = (caddr_t)&kp;
|
||||
kth->ktr_len = sizeof (struct ktr_psig);
|
||||
|
|
|
|||
Loading…
Reference in a new issue