Fix misalignment in nvpair_native_embedded() caused by the compiler

replacing the bzero(). See also revision 195627, which fixed the
misalignment in nvpair_native_embedded_array().

Approved by:	re (kensmith)
This commit is contained in:
Marcel Moolenaar 2009-08-16 01:48:46 +00:00
parent 97e84697ae
commit 538e86713d

View File

@ -2523,14 +2523,15 @@ nvpair_native_embedded(nvstream_t *nvs, nvpair_t *nvp)
{
if (nvs->nvs_op == NVS_OP_ENCODE) {
nvs_native_t *native = (nvs_native_t *)nvs->nvs_private;
nvlist_t *packed = (void *)
char *packed = (void *)
(native->n_curr - nvp->nvp_size + NVP_VALOFF(nvp));
/*
* Null out the pointer that is meaningless in the packed
* structure. The address may not be aligned, so we have
* to use bzero.
*/
bzero(&packed->nvl_priv, sizeof (packed->nvl_priv));
bzero(packed + offsetof(nvlist_t, nvl_priv),
sizeof(((nvlist_t *)NULL)->nvl_priv));
}
return (nvs_embedded(nvs, EMBEDDED_NVL(nvp)));