[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())
Xi Wang writes ("[Xen-devel] [PATCH] x86: fix null pointer dereference in intel_get_extended_msrs()"): > `memset(&mc_ext, 0, ...)' leads to a buffer overflow and a subsequent > null pointer dereference. Replace `&mc_ext' with `mc_ext'. Really I think we shouldn't be writing out these kind of memsets. They're too error-prone. We should have a macro, perhaps like this: #define FILLZERO(object) memset(&(object), 0, sizeof(object)) Likewise a copy macro. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |