Skip to content

Commit

Permalink
[PATCH] radeonfb: Fix static array overrun
Browse files Browse the repository at this point in the history
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 <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Mar 11, 2006
1 parent 8e65098 commit ed62178
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/video/aty/radeon_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ed62178

Please sign in to comment.