[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Hazardous memset/memcpy idiom (was Re: [PATCH] x86: fix null pointer dereference in intel_get_extended_msrs())



Jan Beulich writes ("Hazardous memset/memcpy idiom (was Re: [Xen-devel] [PATCH] 
x86: fix null pointer dereference in intel_get_extended_msrs())"):
> Unfortunately that wouldn't be usable in all cases (arrays passed
> to functions),

 #define FILLZERO_ARRAY(arrayobj, num_elements) \
    (memset((arrayobj),0,sizeof((arrayobj)[0])*(num_elements)))

And the fact that a macro isn't universally applicable isn't a reason
not to replace an error-prone idiom in the very frequent cases where
the macro would be applicable.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.