WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xentop: fix sigsegv

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] xentop: fix sigsegv
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Wed, 19 May 2010 10:55:45 -0700
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 19 May 2010 10:56:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc12 Lightning/1.0b2pre Thunderbird/3.0.4
On my system, I'm getting SIGSEGVs in xentop because xenstat_node_domain()
is returning NULL.  Skip the loop if it does rather than crashing.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>

diff -r 9dda78d7af3b -r 5895ad758076 
tools/xenstat/libxenstat/src/xenstat_linux.c
--- a/tools/xenstat/libxenstat/src/xenstat_linux.c      Tue May 18 15:38:36 
2010 -0700
+++ b/tools/xenstat/libxenstat/src/xenstat_linux.c      Wed May 19 10:53:58 
2010 -0700
@@ -294,7 +294,7 @@
                /* likely using bonding so we alter the configuration for dom0 
to have bridge stats */
                if ((strstr(iface, devBridge) != NULL) && (strstr(iface, 
devNoBridge) == NULL)) {
                        domain = xenstat_node_domain(node, 0);
-                       for (i = 0; i < domain->num_networks; i++) {
+                       for (i = 0; domain && i < domain->num_networks; i++) {
                                if ((domain->networks[i].id == 0) && 
(domain->networks[i].tbytes == 0)
                                        && (domain->networks[i].rbytes == 0)) {
                                                domain->networks[i].tbytes = 
txBytes;



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xentop: fix sigsegv, Jeremy Fitzhardinge <=