Initialize len before passing it to sysctl(3).

ok matthieu@
This commit is contained in:
kettenis 2010-12-06 21:21:52 +00:00
parent a03768fbfb
commit a67ea75b8d

View File

@ -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) {