xentop: fix sigsegv
PATCH 1/1 xentop: fix sigsegv
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 <[email protected]>
tools/xenstat/libxenstat/src/xenstat_linux.c +1 -1
@@ -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;