DragonFlyBSD Kernel Audit
DF-1684 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/misc/syscons/scvidctl.c
+++ b/sys/dev/misc/syscons/scvidctl.c
@@ -315,7 +315,8 @@
     if (ysize <= 0)
 	ysize = info.vi_height/fontsize;
 
-    if ((info.vi_width < xsize*8) || (info.vi_height < ysize*fontsize))
+    if (xsize <= 0 || ysize <= 0 ||
+	xsize > info.vi_width / 8 || ysize > info.vi_height / fontsize)
 	return EINVAL;
 
     /*