Skip to content

Commit

Permalink
[PATCH] fbdev: correct buffer size limit in fbmem_read_proc()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geert Uytterhoeven authored and Linus Torvalds committed Oct 3, 2006
1 parent f5b747b commit a09fd48
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/video/fbmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a09fd48

Please sign in to comment.