]> git.ipfire.org Git - thirdparty/libvirt.git/commit
S390: Fix virSysinfoRead memory corruption
authorViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Fri, 14 Dec 2012 15:08:24 +0000 (16:08 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 17 Dec 2012 17:36:58 +0000 (17:36 +0000)
commitcab938c993cb720daae047dcc0bafe1f339e841c
tree30befd711a9ba7e9c3387ff190669e3ff061ab5f
parent8b8fcdea6eb0459a2e873fa5e1b63bcdc7465a65
S390: Fix virSysinfoRead memory corruption

There was a double free issue caused by virSysinfoRead on s390,
as the same manufacturer string instance was assigned to more
than one processor record.
Cleaned up other potential memory issues and restructured the sysinfo
parsing code by moving repeating patterns into a helper function.

The restructuring made it necessary to conditionally disable
-Wlogical-op for some older GCC versions, using pragma GCC diagnostic.
This is a GCC specific pragma, which is acceptable, since we're
using it to work around a GCC specific bug.

Finally, added a function virSysinfoSetup to configure the sysinfo
data source files/script during run time, to facilitate writing test
programs. This function is not published in sysinfo.h and only
there for testing.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
src/libvirt_private.syms
src/util/sysinfo.c