[libvirt] [PATCH] virsh: poison raw allocation routines

Daniel Veillard veillard at redhat.com
Wed Oct 13 12:14:51 UTC 2010


On Tue, Oct 12, 2010 at 11:26:28AM -0600, Eric Blake wrote:
> * tools/virsh.c (malloc, calloc, realloc, strdup): Enforce that
> within this file, we use the safe vsh wrappers instead.
> (cmdNodeListDevices, cmdSnapshotCreate, main): Fix violations of
> this policy.
> ---
> 
> > Hmm, I also noticed that we're inconsistent on strdup/vshStrdup in
> > this file; separate cleanup patch for that coming up soon.
> 
> The bulk of this patch is code motion.
> 
>  tools/virsh.c |  117 ++++++++++++++++++++++++++++++--------------------------
>  1 files changed, 63 insertions(+), 54 deletions(-)

 ACK,

BTW I should do a followup patch, I had to change .x-sc_prohibit_strncpy
to avoid virsh.c , but the real fix would have been to create a new safe
vsh wrapper for strncpy instead, but this didn't fit well in the middle
of the memory containment patches,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list