[linux-dvb] [PATCH] NXT200X - Change lengths from u8 to int

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 04, 2005 at 12:49:51AM -0500, Michael Krufky wrote:
> Kirk Lapray wrote:
> 
> >This patch changes all lengths from u8 to int types.  It seems to make 
> >more sense that we use int instead of u8.  I am not sure why I didn't 
> >do that in the first place.
> >
> >*nxt200x.c:
> >- Change length types from u8 to int
> >
> >Signed-off-by: Kirk Lapray <kirk.lapray@xxxxxxxxx 
> ><mailto:kirk.lapray@xxxxxxxxx>>
> 
> 
> Applied, Thanks.

This bit is problematic:

-static int nxt200x_writebytes (struct nxt200x_state* state, u8 reg, u8 *buf, u8 len)
+static int nxt200x_writebytes (struct nxt200x_state* state, u8 reg, u8 *buf, int len)
 {
        u8 buf2 [len+1];


akpm already complained about the variable length array on the stack,
now with int instead of u8 it could easily overflow the stack.
How do you guaranteee that this is not going to happen?

Johannes


[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux