From 4cd8f57316cca5eec3fe1916a7aecf76144f472d Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Mon, 6 Dec 2010 21:21:53 +0000 Subject: Initialize len before passing it to sysctl(3). ok matthieu@ --- xserver/hw/xfree86/os-support/bsd/bsd_init.c | 1 + 1 file changed, 1 insertion(+) (limited to 'xserver/hw/xfree86/os-support/bsd/bsd_init.c') 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) { -- cgit v1.2.3