Re: linux-4.12-rc1/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c:2966: cart before the horse ?

2017-05-15 Thread Dan Carpenter
On Sun, May 14, 2017 at 07:19:50PM +, David Binderman wrote:
> Hello there,
> 
> linux-4.12-rc1/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c:2966]: (style) 
> Array index 'i' is used before limits check.
> 
> Source code is
> 
> while (szLine[i] != '{' && i < strlen(szLine))
> i++;
> 

It wouldn't surprise me if this function was buggy somehow but that's a
false positive. i == strlen() is still within bounds because strlen()
returns the number of characters not counting the NUL terminator.

regards,
dan carpenter


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


linux-4.12-rc1/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c:2966: cart before the horse ?

2017-05-14 Thread David Binderman
Hello there,

linux-4.12-rc1/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c:2966]: (style) 
Array index 'i' is used before limits check.

Source code is

while (szLine[i] != '{' && i < strlen(szLine))
i++;

Regards

David Binderman
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel