From 3d5e2a1532fa42742cf349e2db2f58081683c734 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 27 Aug 2007 09:31:31 +0000 Subject: [PATCH] * src/xend_internal.c: applied patch from Masayuki Sunou to avoid memory corruption on very large XML dumps. Daniel --- ChangeLog | 5 +++++ NEWS | 28 ++++++++++++++++++++++++++++ src/xend_internal.c | 12 +++++------- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 93b0026a4e..db321d235d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Aug 27 11:16:48 CEST 2007 Daniel Veillard + + * src/xend_internal.c: applied patch from Masayuki Sunou to avoid + memory corruption on very large XML dumps. + Tue Aug 21 16:48:41 CEST 2007 Daniel Veillard * configure.in libvirt.spec.in include/libvirt/libvirt.h docs/*: diff --git a/NEWS b/NEWS index 1a846d1f81..81f383d1d1 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,34 @@ http://libvirt.org/news.html Releases +0.3.2: Aug 21 2007: + - New features: KVM migration and save/restore (Jim Paris), + added API for migration (Richard Jones), added APIs for block device and + interface statistic (Richard Jones). + - Documentation: examples for XML network APIs, + fix typo and schedinfo synopsis in man page (Atsushi SAKAI), + hypervisor support page update (Richard Jones). + - Bug fixes: remove a couple of leaks in QEmu/KVM backend(Daniel berrange), + fix GnuTLS 1.0 compatibility (Richard Jones), --config/-f option + mistake for libvirtd (Richard Jones), remove leak in QEmu backend + (Jim Paris), fix some QEmu communication bugs (Jim Paris), UUID + lookup though proxy fix, setvcpus checking bugs (with Atsushi SAKAI), + int checking in virsh parameters (with Masayuki Sunou), deny devices + attach/detach for < Xen 3.0.4 (Masayuki Sunou), XenStore query + memory leak (Masayuki Sunou), virsh schedinfo cleanup (Saori Fukuta). + - Improvement: virsh new ttyconsole command, networking API implementation + for test driver (Daniel berrange), qemu/kvm feature reporting of + ACPI/APIC (David Lutterkort), checking of QEmu architectures (Daniel + berrange), improve devices XML errors reporting (Masayuki Sunou), + speedup of domain queries on Xen (Daniel berrange), augment XML dumps + with interface devices names (Richard Jones), internal API to query + drivers for features (Richard Jones). + + - Cleanups: Improve virNodeGetInfo implentation (Daniel berrange), + general UUID code cleanup (Daniel berrange), fix API generator + file selection. + + 0.3.1: Jul 24 2007: - Documentation: index to remote page, script to test certificates, IPv6 remote support docs (Daniel Berrange), document diff --git a/src/xend_internal.c b/src/xend_internal.c index 5a1b09f231..0bd42a700f 100644 --- a/src/xend_internal.c +++ b/src/xend_internal.c @@ -1346,7 +1346,6 @@ xend_parse_sexp_desc_os(virConnectPtr xend, struct sexpr *node, virBufferPtr buf static char * xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersion) { - char *ret; struct sexpr *cur, *node; const char *tmp; char *tty; @@ -1362,10 +1361,9 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi /* ERROR */ return (NULL); } - ret = malloc(4000); - if (ret == NULL) + buf.content = malloc(4000); + if (buf.content == NULL) return (NULL); - buf.content = ret; buf.size = 4000; buf.use = 0; @@ -1762,11 +1760,11 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi virBufferAdd(&buf, "\n", 10); buf.content[buf.use] = 0; - return (ret); + return (buf.content); error: - if (ret != NULL) - free(ret); + if (buf.content != NULL) + free(buf.content); return (NULL); }