From ed62178589929d248a0aaf4018ca3867e2f96d9d Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Sat, 11 Mar 2006 03:27:28 -0800 Subject: [PATCH] [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 --- drivers/video/aty/radeon_monitor.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.41.1