lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 14 Oct 2014 17:10:35 +0000
From:	Hartley Sweeten <HartleyS@...ionengravers.com>
To:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
	Ian Abbott <abbotti@....co.uk>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Chase Southwood <chase.southwood@...oo.com>,
	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] staging: comedi: drivers: comedi_bond.c:  Changed from
 using strncat to strlcat

On Sunday, October 12, 2014 5:23 AM, Rickard Strandqvist wrote:
>
> Changed from using strncat to strlcat to simplify the code
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
> ---
>  drivers/staging/comedi/drivers/comedi_bond.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/comedi_bond.c b/drivers/staging/comedi/drivers/comedi_bond.c
> index 8450c99..5d19861 100644
> --- a/drivers/staging/comedi/drivers/comedi_bond.c
> +++ b/drivers/staging/comedi/drivers/comedi_bond.c
> @@ -262,12 +262,10 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it)
>  			{
>  				/* Append dev:subdev to devpriv->name */
>  				char buf[20];
> -				int left =
> -				    MAX_BOARD_NAME - strlen(devpriv->name) - 1;
>  				snprintf(buf, sizeof(buf), "%u:%u ",
>  					 bdev->minor, bdev->subdev);
> -				buf[sizeof(buf) - 1] = 0;
>-				strncat(devpriv->name, buf, left);
> +				strlcat(devpriv->name, buf,
> +					sizeof(devpriv->name));
>  			}
>  
>  		}

Reviewed-by: H Hartley Sweeten <hsweeten@...ionengravers.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists