Re: [PATCH] S390: Fix virSysinfoRead memory corruption

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

 



On Fri, Dec 07, 2012 at 09:44:35AM +0100, Viktor Mihajlovski wrote:
> 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.
> 
> BTW: I hit an issue with using strchr(string,variable), as I am
> still compiling with gcc 4.4.x, see
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36513
> I circumvented this using index(), which is deprecated, but working.
> 
> Signed-off-by: Viktor Mihajlovski <mihajlov@xxxxxxxxxxxxxxxxxx>
> ---
>  src/util/sysinfo.c |  160 ++++++++++++++++++++++-----------------------------
>  1 files changed, 69 insertions(+), 91 deletions(-)

Given the complexity the parsing it would be nice to add a test
case for this. It is a shame we don't already have a test case
for the sysinfo code in fact :-( I'd like to see test/virsysinfotest.c
to validate this parsing. Take a 'char *str' containing representation
data from /proc/sysinfo, run it through the parser & then validate the
result.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]