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]
Date:	Fri, 01 Aug 2014 00:31:43 +0200
From:	"Rafael J. Wysocki" <rjw@...ysocki.net>
To:	Randy Dunlap <rdunlap@...radead.org>
Cc:	Arjun Sreedharan <arjun024@...il.com>, lenb@...nel.org,
	linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
	joe@...ches.com
Subject: Re: [PATCH] Replace faulty is_hex_digit() by isxdigit()

On Thursday, July 31, 2014 09:31:37 AM Randy Dunlap wrote:
> On 07/31/14 02:04, Arjun Sreedharan wrote:
> > 0 is ascii for NULL. Hex digit matching should be from '0'.
> > Faulty version returns true for #,$,%,& etc.
> > 
> > Signed-off-by: Arjun Sreedharan <arjun024@...il.com>
> 
> Acked-by: Randy Dunlap <rdunlap@...radead.org>

Applied, thanks!

> Thanks.
> 
> > ---
> >  drivers/acpi/acpi_pnp.c | 8 ++------
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/acpi/acpi_pnp.c b/drivers/acpi/acpi_pnp.c
> > index 4ddb0dc..996fa19 100644
> > --- a/drivers/acpi/acpi_pnp.c
> > +++ b/drivers/acpi/acpi_pnp.c
> > @@ -12,6 +12,7 @@
> >  
> >  #include <linux/acpi.h>
> >  #include <linux/module.h>
> > +#include <linux/ctype.h>
> >  
> >  static const struct acpi_device_id acpi_pnp_device_ids[] = {
> >  	/* soc_button_array */
> > @@ -320,11 +321,6 @@ static const struct acpi_device_id acpi_pnp_device_ids[] = {
> >  	{""},
> >  };
> >  
> > -static bool is_hex_digit(char c)
> > -{
> > -	return (c >= 0 && c <= '9') || (c >= 'A' && c <= 'F');
> > -}
> > -
> >  static bool matching_id(char *idstr, char *list_id)
> >  {
> >  	int i;
> > @@ -335,7 +331,7 @@ static bool matching_id(char *idstr, char *list_id)
> >  	for (i = 3; i < 7; i++) {
> >  		char c = toupper(idstr[i]);
> >  
> > -		if (!is_hex_digit(c)
> > +		if (!isxdigit(c)
> >  		    || (list_id[i] != 'X' && c != toupper(list_id[i])))
> >  			return false;
> >  	}
> > 
> 
> 
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ