Skip to content

Commit

Permalink
Fix an uninitialized pointer deref introduced in rev 1.207.
Browse files Browse the repository at this point in the history
Reported-by: syzbot+6d69101d5f2fd954c4e2@syzkaller.appspotmail.com
  • Loading branch information
thorpej committed Dec 6, 2020
1 parent 0caa7a0 commit fbb685b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sys/kern/kern_time.c
@@ -1,4 +1,4 @@
/* $NetBSD: kern_time.c,v 1.207 2020/12/05 18:17:01 thorpej Exp $ */
/* $NetBSD: kern_time.c,v 1.208 2020/12/06 13:45:58 thorpej Exp $ */

/*-
* Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009, 2020
Expand Down Expand Up @@ -62,7 +62,7 @@
*/

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.207 2020/12/05 18:17:01 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.208 2020/12/06 13:45:58 thorpej Exp $");

#include <sys/param.h>
#include <sys/resourcevar.h>
Expand Down Expand Up @@ -1243,10 +1243,10 @@ timer_create1(timer_t *tid, clockid_t id, struct sigevent *evp,

switch (id) {
case CLOCK_VIRTUAL:
itl = &pt->pt_proc->p_timers->pts_virtual;
itl = &pts->pts_virtual;
break;
case CLOCK_PROF:
itl = &pt->pt_proc->p_timers->pts_prof;
itl = &pts->pts_prof;
break;
default:
itl = NULL;
Expand Down Expand Up @@ -1642,11 +1642,11 @@ dosetitimer(struct proc *p, int which, struct itimerval *itvp)
pt->pt_ev.sigev_signo = SIGALRM;
break;
case ITIMER_VIRTUAL:
itl = &pt->pt_proc->p_timers->pts_virtual;
itl = &pts->pts_virtual;
pt->pt_ev.sigev_signo = SIGVTALRM;
break;
case ITIMER_PROF:
itl = &pt->pt_proc->p_timers->pts_prof;
itl = &pts->pts_prof;
pt->pt_ev.sigev_signo = SIGPROF;
break;
}
Expand Down

0 comments on commit fbb685b

Please sign in to comment.