From 804e20e6c3d09246ff954181e7c181ef34a65a39 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 7 Dec 2006 18:23:19 +0000 Subject: [PATCH] Add array bounds checking in xendDaemonListDomains --- ChangeLog | 9 +++++++-- src/xend_internal.c | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b99299742..330e2a5ddc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -Mon Dec 6 17:46:03 EST 2006 Daniel Berrange +Thu Dec 7 12:28:03 EST 2006 Daniel Berrange + + * src/xend_internal.c: Add bounds checking in xenDaemonListDomains to + avoid overflowing the 'ids' array. + +Wed Dec 6 17:46:03 EST 2006 Daniel Berrange * src/xend_internal.c: Support parsing of new paravirt framebuffer graphics configuration from xen 3.0.4 tree. @@ -6,7 +11,7 @@ Mon Dec 6 17:46:03 EST 2006 Daniel Berrange config parsing in paravirt & fullyvirt. * test/sexpr2xmldata/sexpr2xml-pv-vfb-*: New test data files -Mon Dec 6 17:40:03 EST 2006 Daniel Berrange +Wed Dec 6 17:40:03 EST 2006 Daniel Berrange * test/xml2sexprdata/xml2sexpr-curmem.xml, test/xml2sexprdata/xml2sexpr-curmem.sexpr: Fix test case to reflect recent change to bootloader/image handling diff --git a/src/xend_internal.c b/src/xend_internal.c index 3e73ef3493..e3f652c70c 100644 --- a/src/xend_internal.c +++ b/src/xend_internal.c @@ -2625,7 +2625,9 @@ xenDaemonListDomains(virConnectPtr conn, int *ids, int maxids) continue; id = xenDaemonDomainLookupByName_ids(conn, node->value, NULL); if (id >= 0) - ids[ret++] = (int) id; + ids[ret++] = (int) id; + if (ret >= maxids) + break; } error: