Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jun 2017 23:29:52 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Mark Johnston <markj@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r319868 - in head/sys: kern sys
Message-ID:  <20170612202952.GU2088@kib.kiev.ua>
In-Reply-To: <201706122014.v5CKEitK071089@repo.freebsd.org>
References:  <201706122014.v5CKEitK071089@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jun 12, 2017 at 08:14:44PM +0000, Mark Johnston wrote:
> +int
> +uuidcmp(const struct uuid *uuid1, const struct uuid *uuid2)
> +{
> +
> +	return (memcmp(uuid1, uuid2, sizeof(struct uuid)));
> +}

This is unsafe.  The function operation depends on the ABI properties
that there is no padding either between members, or at the end of
the structure.  Why not use by-member comparision ?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170612202952.GU2088>