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:	Wed, 01 Nov 2006 10:20:49 -0800
From:	Randy Dunlap <randy.dunlap@...cle.com>
To:	Derek Fults <dfults@....com>
CC:	linux-kernel@...r.kernel.org, Andi Kleen <ak@...e.de>
Subject: Re: [PATCH] Add get_range, allows a hyhpenated range to get_options

Derek Fults wrote:
>> How does get_range() handle errors, like input of
>> 	64-60
>> or	64-N
>> or	64-
>> ?
>>
> get_range will return a negative value which caused it to break out of
> the while loop on the next iteration.  I've added a check of the
> get_range return value to break immediately. See snippet.  
> If get_options is called with a bad range, 
> 64-N,65
> returns and empty array.
> 63,64-N
> returns an array with just 63.  

OK, thanks.

> 		if (res == 3) {
> 			int range_nums;
> 			range_nums = get_range((char **)&str, ints + i);
> +			if ( range_nums < 0)

no space after '('

> +					break;
> 			/* Decrement the result by one to leave out the
> 			   last number in the range.  The next iteration
> 			   will handle the upper number in the range */
> 			i += (range_nums - 1);
> 		}
> 
> Derek


-- 
~Randy
-
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