which way to update export_args structure?

John-Mark Gurney jmg at funkthat.com
Tue Oct 23 17:04:35 UTC 2018


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));
> 
> I think this is now redundant.
> 
> > +				memset(&o2export, 0, sizeof(o2export));
> 
> This is certainly redundant given that you immediately copy over it.

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

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

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

     "All that I will do, has been done, All that I have, has not."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20181023/8292714e/attachment.sig>


More information about the freebsd-current mailing list