From: Antonino A. Daplas Date: Sat, 11 Mar 2006 11:27:28 +0000 (-0800) Subject: [PATCH] radeonfb: Fix static array overrun X-Git-Tag: v2.6.16-rc6~7 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=ed62178589929d248a0aaf4018ca3867e2f96d9d;p=~shefty%2Frdma-dev.git [PATCH] radeonfb: Fix static array overrun radeonfb_parse_monitor_layout() will produce an array overrun if passed with a substring of length higher than 4 (ie, "XXXXX,YYYYYY"). Coverity Bug 494 Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c index 7f9838dceab..98c05bc0de4 100644 --- a/drivers/video/aty/radeon_monitor.c +++ b/drivers/video/aty/radeon_monitor.c @@ -396,6 +396,10 @@ static int __devinit radeon_parse_monitor_layout(struct radeonfb_info *rinfo, s1[i] = *s; i++; } + + if (i > 4) + i = 4; + } while (*s++); if (second) s2[i] = 0;