Re: [PATCH] cxd2820r: fix possible out-of-array lookup

2011-07-25 Thread HoP
Hi Antti 2011/7/23 Antti Palosaari cr...@iki.fi: On 07/23/2011 02:01 AM, HoP wrote: 2011/7/23 Antti Palosaaricr...@iki.fi: On 07/23/2011 01:47 AM, HoP wrote: 2011/7/23 Antti Palosaaricr...@iki.fi: On 07/23/2011 01:18 AM, HoP wrote: In case of i2c write operation there is only one

Re: [PATCH] cxd2820r: fix possible out-of-array lookup

2011-07-23 Thread Malcolm Priestley
On Sat, 2011-07-23 at 01:47 +0200, HoP wrote: 2011/7/23 Antti Palosaari cr...@iki.fi: On 07/23/2011 02:31 AM, Antti Palosaari wrote: On 07/23/2011 02:01 AM, HoP wrote: 2011/7/23 Antti Palosaaricr...@iki.fi: But now I see what you mean. msg2[1] is set as garbage fields in case of

Re: [PATCH] cxd2820r: fix possible out-of-array lookup

2011-07-23 Thread HoP
2011/7/23 Malcolm Priestley tvbox...@gmail.com: On Sat, 2011-07-23 at 01:47 +0200, HoP wrote: 2011/7/23 Antti Palosaari cr...@iki.fi: On 07/23/2011 02:31 AM, Antti Palosaari wrote: On 07/23/2011 02:01 AM, HoP wrote: 2011/7/23 Antti Palosaaricr...@iki.fi: But now I see what you

[PATCH] cxd2820r: fix possible out-of-array lookup

2011-07-22 Thread HoP
In case of i2c write operation there is only one element in msg[] array. Don't access msg[1] in that case. Signed-off-by: Honza Petrous jpetr...@smartimp.cz -- diff -uBbp cxd2820r_core.c.orig cxd2820r_core.c --- cxd2820r_core.c.orig2011-07-22 23:31:56.319168405 +0200 +++ cxd2820r_core.c

Re: [PATCH] cxd2820r: fix possible out-of-array lookup

2011-07-22 Thread HoP
2011/7/23 Antti Palosaari cr...@iki.fi: On 07/23/2011 01:18 AM, HoP wrote: In case of i2c write operation there is only one element in msg[] array. Don't access msg[1] in that case. NACK. I suspect you confuse now local msg2 and msg that is passed as function parameter. Could you double

Re: [PATCH] cxd2820r: fix possible out-of-array lookup

2011-07-22 Thread Antti Palosaari
On 07/23/2011 01:47 AM, HoP wrote: 2011/7/23 Antti Palosaaricr...@iki.fi: On 07/23/2011 01:18 AM, HoP wrote: In case of i2c write operation there is only one element in msg[] array. Don't access msg[1] in that case. NACK. I suspect you confuse now local msg2 and msg that is passed as

Re: [PATCH] cxd2820r: fix possible out-of-array lookup

2011-07-22 Thread HoP
2011/7/23 Antti Palosaari cr...@iki.fi: On 07/23/2011 01:47 AM, HoP wrote: 2011/7/23 Antti Palosaaricr...@iki.fi: On 07/23/2011 01:18 AM, HoP wrote: In case of i2c write operation there is only one element in msg[] array. Don't access msg[1] in that case. NACK. I suspect you confuse now

Re: [PATCH] cxd2820r: fix possible out-of-array lookup

2011-07-22 Thread Antti Palosaari
On 07/23/2011 02:01 AM, HoP wrote: 2011/7/23 Antti Palosaaricr...@iki.fi: On 07/23/2011 01:47 AM, HoP wrote: 2011/7/23 Antti Palosaaricr...@iki.fi: On 07/23/2011 01:18 AM, HoP wrote: In case of i2c write operation there is only one element in msg[] array. Don't access msg[1] in that case.

Re: [PATCH] cxd2820r: fix possible out-of-array lookup

2011-07-22 Thread Antti Palosaari
On 07/23/2011 02:31 AM, Antti Palosaari wrote: On 07/23/2011 02:01 AM, HoP wrote: 2011/7/23 Antti Palosaaricr...@iki.fi: But now I see what you mean. msg2[1] is set as garbage fields in case of incoming msg len is 1. True, but it does not harm since it is not used in that case. In case of

Re: [PATCH] cxd2820r: fix possible out-of-array lookup

2011-07-22 Thread HoP
2011/7/23 Antti Palosaari cr...@iki.fi: On 07/23/2011 02:31 AM, Antti Palosaari wrote: On 07/23/2011 02:01 AM, HoP wrote: 2011/7/23 Antti Palosaaricr...@iki.fi: But now I see what you mean. msg2[1] is set as garbage fields in case of incoming msg len is 1. True, but it does not harm since