bin/119483: vidcontrol miss latest VESA mode (off-by-one bug)

Dan Lukes dan at obluda.cz
Wed Jan 9 02:30:02 PST 2008


>Number:         119483
>Category:       bin
>Synopsis:       vidcontrol miss latest VESA mode (off-by-one bug)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 09 10:30:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Dan Lukes
>Release:        FreeBSD 6.3-PRERELEASE i386
>Organization:
Obludarium
>Environment:
System: FreeBSD kulesh.obluda.cz 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #0: Mon Jan 7 20:31:37 CET 2008 root@:/usr/obj/usr/src/sys/KULESH i386
src/usr.sbin/vidcontrol/vidcontrol.c,v 1.52.2.2 2006/10/04 06:09:11

>Description:
	vidcontrol -i mode
	miss the mode 0x1ff=M_VESA_MODE_MAX in listing due off-by-one bug
	The M_VESA_MODE_MAX is latest valid mode - not the first invalid

>How-To-Repeat:
	use vidcontrol -i mode on hardware which has 0x1ff mode - it will
not be listed
>Fix:


--- /usr/src/usr.sbin/vidcontrol/vidcontrol.c.ORIG	2008-01-09 11:20:05.000000000 +0100
+++ /usr/src/usr.sbin/vidcontrol/vidcontrol.c	2008-01-09 11:20:35.000000000 +0100
@@ -960,7 +960,7 @@
 	printf("---------------------------------------"
 	       "---------------------------------------\n");
 
-	for (mode = 0; mode < M_VESA_MODE_MAX; ++mode) {
+	for (mode = 0; mode <= M_VESA_MODE_MAX; ++mode) {
 		_info.vi_mode = mode;
 		if (ioctl(0, CONS_MODEINFO, &_info))
 			continue;

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list