Re: [PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-05-02 Thread Ajay Singh
On Wed, 2 May 2018 11:39:36 +0300 Dan Carpenter wrote: > We're mainly discussing readability, right? > > To me when people use "int" that tells me as a reader that we don't > need to think about the type. It's going to be a small number. > > Say you have data which

Re: [PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-05-02 Thread Ajay Singh
On Wed, 2 May 2018 11:39:36 +0300 Dan Carpenter wrote: > We're mainly discussing readability, right? > > To me when people use "int" that tells me as a reader that we don't > need to think about the type. It's going to be a small number. > > Say you have data which the user can control, then

Re: [PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-05-02 Thread Dan Carpenter
We're mainly discussing readability, right? To me when people use "int" that tells me as a reader that we don't need to think about the type. It's going to be a small number. Say you have data which the user can control, then it's super important to focus on the data types. We don't focus on

Re: [PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-05-02 Thread Dan Carpenter
We're mainly discussing readability, right? To me when people use "int" that tells me as a reader that we don't need to think about the type. It's going to be a small number. Say you have data which the user can control, then it's super important to focus on the data types. We don't focus on

Re: [PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-05-01 Thread Ajay Singh
On Mon, 30 Apr 2018 18:23:21 +0300 Dan Carpenter wrote: > On Mon, Apr 30, 2018 at 07:59:16PM +0530, Ajay Singh wrote: > > Reviewed-by: Ajay Singh > > > > On Mon, 30 Apr 2018 07:50:40 -0500 > > "Gustavo A. R. Silva"

Re: [PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-05-01 Thread Ajay Singh
On Mon, 30 Apr 2018 18:23:21 +0300 Dan Carpenter wrote: > On Mon, Apr 30, 2018 at 07:59:16PM +0530, Ajay Singh wrote: > > Reviewed-by: Ajay Singh > > > > On Mon, 30 Apr 2018 07:50:40 -0500 > > "Gustavo A. R. Silva" wrote: > > > > > If i < slot_id is initially true then it will remain true.

Re: [PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-04-30 Thread Dan Carpenter
On Mon, Apr 30, 2018 at 07:59:16PM +0530, Ajay Singh wrote: > Reviewed-by: Ajay Singh > > On Mon, 30 Apr 2018 07:50:40 -0500 > "Gustavo A. R. Silva" wrote: > > > If i < slot_id is initially true then it will remain true. Also, > > as i is

Re: [PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-04-30 Thread Dan Carpenter
On Mon, Apr 30, 2018 at 07:59:16PM +0530, Ajay Singh wrote: > Reviewed-by: Ajay Singh > > On Mon, 30 Apr 2018 07:50:40 -0500 > "Gustavo A. R. Silva" wrote: > > > If i < slot_id is initially true then it will remain true. Also, > > as i is being decremented it will end up accessing memory out

Re: [PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-04-30 Thread Ajay Singh
Reviewed-by: Ajay Singh On Mon, 30 Apr 2018 07:50:40 -0500 "Gustavo A. R. Silva" wrote: > If i < slot_id is initially true then it will remain true. Also, > as i is being decremented it will end up accessing memory out of > bounds. > > Fix

Re: [PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-04-30 Thread Ajay Singh
Reviewed-by: Ajay Singh On Mon, 30 Apr 2018 07:50:40 -0500 "Gustavo A. R. Silva" wrote: > If i < slot_id is initially true then it will remain true. Also, > as i is being decremented it will end up accessing memory out of > bounds. > > Fix this by incrementing *i* instead of decrementing it.

[PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-04-30 Thread Gustavo A. R. Silva
If i < slot_id is initially true then it will remain true. Also, as i is being decremented it will end up accessing memory out of bounds. Fix this by incrementing *i* instead of decrementing it. Addresses-Coverity-ID: 1468454 ("Infinite loop") Fixes: faa657641081 ("staging: wilc1000: refactor

[PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-04-30 Thread Gustavo A. R. Silva
If i < slot_id is initially true then it will remain true. Also, as i is being decremented it will end up accessing memory out of bounds. Fix this by incrementing *i* instead of decrementing it. Addresses-Coverity-ID: 1468454 ("Infinite loop") Fixes: faa657641081 ("staging: wilc1000: refactor