From: Geert Uytterhoeven Date: Tue, 3 Oct 2006 08:15:11 +0000 (-0700) Subject: [PATCH] fbdev: correct buffer size limit in fbmem_read_proc() X-Git-Tag: v2.6.19-rc1~285 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a09fd48f8fb6ecb8bf85efdd884b21b6201ef9cc;p=linux-2.6 [PATCH] fbdev: correct buffer size limit in fbmem_read_proc() Address http://bugzilla.kernel.org/show_bug.cgi?id=7189 It should check `clen', not `len'. Signed-off-by: Geert Uytterhoeven Cc: Cc: "Antonino A. Daplas" Cc: Cc: Willy Tarreau Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 17961e3eca..93ffcdd95f 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -554,7 +554,8 @@ static int fbmem_read_proc(char *buf, char **start, off_t offset, int clen; clen = 0; - for (fi = registered_fb; fi < ®istered_fb[FB_MAX] && len < 4000; fi++) + for (fi = registered_fb; fi < ®istered_fb[FB_MAX] && clen < 4000; + fi++) if (*fi) clen += sprintf(buf + clen, "%d %s\n", (*fi)->node,