diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-09-22 19:47:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:51 -0400 |
commit | d63870db3c41086d7f13ec8b41def4331db32327 (patch) | |
tree | 9ad9322832081f3a5d15321c56dbd7b5d86e44c6 /drivers/video/sis/sis_main.c | |
parent | 2f93e8f4822fdd48fa9c4c901eea87ab1c902f87 (diff) |
sisfb: read buffer overflow
If called with mode_idx = 1, rate = 68, a read occurs from
sisfb_vrate[-1].refresh.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Thomas Winischhofer <thomas@winischhofer.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/sis/sis_main.c')
-rw-r--r-- | drivers/video/sis/sis_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c index 4a067f0d0ceb..a4e05e4d7501 100644 --- a/drivers/video/sis/sis_main.c +++ b/drivers/video/sis/sis_main.c | |||
@@ -698,8 +698,8 @@ sisfb_search_refresh_rate(struct sis_video_info *ivideo, unsigned int rate, int | |||
698 | rate, sisfb_vrate[i].refresh); | 698 | rate, sisfb_vrate[i].refresh); |
699 | ivideo->rate_idx = sisfb_vrate[i].idx; | 699 | ivideo->rate_idx = sisfb_vrate[i].idx; |
700 | ivideo->refresh_rate = sisfb_vrate[i].refresh; | 700 | ivideo->refresh_rate = sisfb_vrate[i].refresh; |
701 | } else if(((rate - sisfb_vrate[i-1].refresh) <= 2) | 701 | } else if((sisfb_vrate[i].idx != 1) && |
702 | && (sisfb_vrate[i].idx != 1)) { | 702 | ((rate - sisfb_vrate[i-1].refresh) <= 2)) { |
703 | DPRINTK("sisfb: Adjusting rate from %d down to %d\n", | 703 | DPRINTK("sisfb: Adjusting rate from %d down to %d\n", |
704 | rate, sisfb_vrate[i-1].refresh); | 704 | rate, sisfb_vrate[i-1].refresh); |
705 | ivideo->rate_idx = sisfb_vrate[i-1].idx; | 705 | ivideo->rate_idx = sisfb_vrate[i-1].idx; |