diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-12-06 21:21:53 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-12-06 21:21:53 +0000 |
commit | 4cd8f57316cca5eec3fe1916a7aecf76144f472d (patch) | |
tree | 46044022312611fe38d0778782c4e8ae4cacff64 /xserver/hw/xfree86/os-support/bsd/bsd_init.c | |
parent | 2a7636695086434171c590b4851ab6111b1e890b (diff) |
Initialize len before passing it to sysctl(3).
ok matthieu@
Diffstat (limited to 'xserver/hw/xfree86/os-support/bsd/bsd_init.c')
-rw-r--r-- | xserver/hw/xfree86/os-support/bsd/bsd_init.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_init.c b/xserver/hw/xfree86/os-support/bsd/bsd_init.c index 20c516962..7d378bf08 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_init.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_init.c @@ -650,6 +650,7 @@ xf86OpenWScons() #ifdef KERN_CONSDEV mib[0] = CTL_KERN; mib[1] = KERN_CONSDEV; + len = sizeof(dev); if (sysctl(mib, 2, &dev, &len, NULL, 0) != -1) { snprintf(ttyname, sizeof(ttyname), "/dev/%s", devname(dev, S_IFCHR)); if ((fd = open(ttyname, 2)) != -1) { |