Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Oct 2018 10:04:32 -0700
From:      John-Mark Gurney <jmg@funkthat.com>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        Rick Macklem <rmacklem@uoguelph.ca>, FreeBSD Current <freebsd-current@freebsd.org>, Josh Paetzel <josh@tcbug.org>
Subject:   Re: which way to update export_args structure?
Message-ID:  <20181023170432.GA75530@funkthat.com>
In-Reply-To: <20181022160508.GB45769@spindle.one-eyed-alien.net>
References:  <YTOPR0101MB182021549F8CF8277477A4C5DDE90@YTOPR0101MB1820.CANPRD01.PROD.OUTLOOK.COM> <20181003155133.GA57729@spindle.one-eyed-alien.net> <YTOPR0101MB18207FF98DED0232B9BB1B4FDDE50@YTOPR0101MB1820.CANPRD01.PROD.OUTLOOK.COM> <20181008170428.GB9766@spindle.one-eyed-alien.net> <YTOPR0101MB11626B32F73B520FBDA3C633DDFA0@YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM> <20181022160508.GB45769@spindle.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--xB0nW4MQa6jZONgY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Brooks Davis wrote this message on Mon, Oct 22, 2018 at 16:05 +0000:
> > +			switch (len) {
> > +			case (sizeof(struct oexport_args)):
> > +			case (sizeof(struct o2export_args)):
> > +				memset(&export, 0, sizeof(export));
>=20
> I think this is now redundant.
>=20
> > +				memset(&o2export, 0, sizeof(o2export));
>=20
> This is certainly redundant given that you immediately copy over it.

This is not redundant if sizeof oexport_args < sizeof o2export, and
len =3D=3D sizeof oexport_args...  It zeros out the remaining of the buffer=
=2E.

> > +				memcpy(&o2export, bufp, len);

--=20
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."

--xB0nW4MQa6jZONgY
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQJ8BAEBCgBmBQJbz1SfXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2MEI1RTRGMTNDNzYyMDZDNjEyMDBCNjAy
MDVGMEIzM0REMDA2QURBAAoJECBfCzPdAGratBAQAJJ5iFD1v7pXoqcfux12Zh7R
23ii+X8jMbDICtS1L6OP85Wa1dHHrzTz8h5Ro17Ri9dMPYj0M18/3l7XnUBMBWLt
aXqiaCIjBB9eKafHWIbXSbxyxPLrp2H86C2ZPBB4gtcFMxUYNt5rLWLw3NBm5Mz1
GAdxDMBlhIyAPCuFI6F9ioDE2tJNKgz0M0TUvuNRUZO5RocRbH8JD+Ny2nrdcZsl
CUx1He9E1xDP/JkRbgdbHY2X0tp2YqWlHjKFrfM0r9rq4pXsPDgDGp6dKY5Pcb9O
qREf3Id2c17YtyUKR6W6UyNrbgSOZhRQrc/zWzmNzdjoj2t9pwnzV23sR0McHVuw
BOQS4rBU70j3ZdGeqLqWfrvFPUwDNU/Ez3jQ8N2fXnP31hrSClqyjltcTBCyuarM
dJ4zyS9XD6UNOZea5sUpPe+x0yqrFzM/UYp/pJaDhqDo+oIcPCQ9tYHE1STVlaYM
OGRlBbdoB6ORoX+XQYGojpsTFIL5Wj4KJQcOnPYLd4LYi2BmHaoCJSlHsLxMocvK
CkkUHWpmCRSr8uTbkNSW0Ipb7kas5I62SSYRxLH+7sRRYS4IdeuFG9D4wzWVpi5A
ZEUMcgbLF6eVRUc81OiPu55bsfSooBFY+l5PsZapOVfSav7HL2Eto7DkeJUElCb+
qPlXiBwJ6KincWDNn5+a
=quRR
-----END PGP SIGNATURE-----

--xB0nW4MQa6jZONgY--



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