summaryrefslogtreecommitdiff
path: root/xserver/hw
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2010-12-06 21:21:53 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2010-12-06 21:21:53 +0000
commit4cd8f57316cca5eec3fe1916a7aecf76144f472d (patch)
tree46044022312611fe38d0778782c4e8ae4cacff64 /xserver/hw
parent2a7636695086434171c590b4851ab6111b1e890b (diff)
Initialize len before passing it to sysctl(3).
ok matthieu@
Diffstat (limited to 'xserver/hw')
-rw-r--r--xserver/hw/xfree86/os-support/bsd/bsd_init.c1
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) {