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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100922190340.GF26903@fieldses.org>
Date:	Wed, 22 Sep 2010 15:03:40 -0400
From:	"J. Bruce Fields" <bfields@...ldses.org>
To:	Andy Shevchenko <andy.shevchenko@...il.com>
Cc:	linux-kernel@...r.kernel.org,
	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
	Trond Myklebust <Trond.Myklebust@...app.com>,
	linux-nfs@...r.kernel.org
Subject: Re: [PATCHv1.5 2/3] sunrpc/cache: don't use custom hex_to_bin()
 converter

On Tue, Sep 21, 2010 at 09:40:25AM +0300, Andy Shevchenko wrote:
> Signed-off-by: Andy Shevchenko <andy.shevchenko@...il.com>
> Cc: Trond Myklebust <Trond.Myklebust@...app.com>
> Cc: linux-nfs@...r.kernel.org

Thanks, applied for 2.6.37.

--b.

> ---
>  net/sunrpc/cache.c |   20 +++++++++++++-------
>  1 files changed, 13 insertions(+), 7 deletions(-)
> 
> diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
> index 5b7b56f..c944a24 100644
> --- a/net/sunrpc/cache.c
> +++ b/net/sunrpc/cache.c
> @@ -1171,13 +1171,19 @@ int qword_get(char **bpp, char *dest, int bufsize)
>  	if (bp[0] == '\\' && bp[1] == 'x') {
>  		/* HEX STRING */
>  		bp += 2;
> -		while (isxdigit(bp[0]) && isxdigit(bp[1]) && len < bufsize) {
> -			int byte = isdigit(*bp) ? *bp-'0' : toupper(*bp)-'A'+10;
> -			bp++;
> -			byte <<= 4;
> -			byte |= isdigit(*bp) ? *bp-'0' : toupper(*bp)-'A'+10;
> -			*dest++ = byte;
> -			bp++;
> +		while (len < bufsize) {
> +			int h, l;
> +
> +			h = hex_to_bin(bp[0]);
> +			if (h < 0)
> +				break;
> +
> +			l = hex_to_bin(bp[1]);
> +			if (l < 0)
> +				break;
> +
> +			*dest++ = (h << 4) | l;
> +			bp += 2;
>  			len++;
>  		}
>  	} else {
> -- 
> 1.7.2.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ