svn commit: r265901 - stable/10/sys/kern

Andrey Chernov ache at freebsd.org
Mon May 12 16:04:44 UTC 2014


On 12.05.2014 8:27, Don Lewis wrote:
> +	if (start + amask < start) {
> +		DPRINTF(("start+amask wrapped around\n"));
> +		goto out;
> +	}

Checking for overflow _after_ it happens is unportable and dangerous,
since wrapping around is not only one possible result. They should be
rewritten like that:

if (start > ULONG_MAX - amask)


-- 
http://ache.vniz.net/


More information about the svn-src-stable mailing list