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] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D4111F1E0@AcuExch.aculab.com>
Date:	Mon, 14 Mar 2016 16:43:27 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Ben Hutchings' <ben@...adent.org.uk>,
	David Decotigny <ddecotig@...il.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:	Jeff Garzik <jgarzik@...ox.com>, David Miller <davem@...hat.com>,
	"Vidya Sagar Ravipati" <vidya@...ulusnetworks.com>,
	Joe Perches <joe@...ches.com>,
	David Decotigny <decot@...glers.com>
Subject: RE: [ethtool PATCH v4 10/11] ethtool.c: add support for
 ETHTOOL_xLINKSETTINGS ioctls

> > +	/* ignore optional '0x' prefix */
> > +	if ((slen > 2) && (

Unnecessary ().

> > +		    (0 == memcmp(s, "0x", 2)
> > +		     || (0 == memcmp(s, "0X", 2))))) {

A-about-F comparisons.

> memcmp() is a really poor tool for comparing strings.  You should use
> strncasecmp() here.

Even that is overkill, why not just:
	if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X'))

	David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ