Skip to contentSkip to conversation

carminefb: beyond ARRAY_SIZE of carmine_modedb

PATCH Andrew Morton 1 participant 1 message May 27, 2009 1 message not in the archive Framebuffer layer

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 1 line · On Wed, 20 May 2009 02:41:18 +0200 Roel Kluin <[email protected]> wrote:

You mistyped the list address.

Quoted 5 lines

Subject: [PATCH] carminefb: beyond ARRAY_SIZE of carmine_modedb
Date: Wed, 20 May 2009 02:41:18 +0200
User-Agent: Thunderbird 2.0.0.21 (X11/20090302)

Do not go beyond ARRAY_SIZE ofcarmine_modedb

Sort-of. I changed the title and changelog:

Subject: carminefb: fix possible access beyond end of carmine_modedb[]
From: Roel Kluin <[email protected]>

This check is off-by-one.

Cc Sebastian Siewior <[email protected]>
Cc Krzysztof Helt <[email protected]>

---

 drivers/video/carminefb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/carminefb.c renamed from drivers/video/carminefb.c~carminefb-beyond-array_size-of-carmine_modedb +1 -1
diff -puN drivers/video/carminefb.c~carminefb-beyond-array_size-of-carmine_modedb drivers/video/carminefb.c
@@ -562,7 +562,7 @@ static int __devinit alloc_carmine_fb(vo
 	if (ret < 0)
 		goto err_free_fb;
 
-	if (fb_mode > ARRAY_SIZE(carmine_modedb))
+	if (fb_mode >= ARRAY_SIZE(carmine_modedb))
 		fb_mode = CARMINEFB_DEFAULT_VIDEO_MODE;
 
 	par->cur_mode = par->new_mode = ~0;

_

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com