From: Brett Gordon Date: Fri, 23 Oct 2015 06:10:14 +0000 (-0400) Subject: coco3: graphics: fix bounds checking X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=10952ed7f587d600c4ed0b87a35d81d2de0ba913;p=FUZIX.git coco3: graphics: fix bounds checking --- diff --git a/Kernel/platform-coco3/video.c b/Kernel/platform-coco3/video.c index 447c6676..181f55ab 100644 --- a/Kernel/platform-coco3/video.c +++ b/Kernel/platform-coco3/video.c @@ -148,8 +148,8 @@ int gfx_draw_op(uarg_t arg, char *ptr) break; } l -= 8; - if (p[0] > 31 || p[1] > 191 || p[2] > 31 || p[3] > 191 || - p[0] + p[2] > 32 || p[1] + p[3] > 192 || + if (p[0] > 191 || p[1] > 31 || p[2] > 191 || p[3] > 31 || + p[0] + p[2] > 191 || p[1] + p[3] > 31 || (p[2] * p[3]) > l) { err = -EFAULT; break;