[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 <geert@linux-m68k.org>
Cc: <jurij@wooyd.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: <stable@kernel.org>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Geert Uytterhoeven 2006-10-03 01:15:11 -07:00 committed by Linus Torvalds
parent f5b747b487
commit a09fd48f8f
1 changed files with 2 additions and 1 deletions

View File

@ -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 < &registered_fb[FB_MAX] && len < 4000; fi++)
for (fi = registered_fb; fi < &registered_fb[FB_MAX] && clen < 4000;
fi++)
if (*fi)
clen += sprintf(buf + clen, "%d %s\n",
(*fi)->node,