diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index 7bba4120bd6a9de3599d21e87093e7632284d5fb..c2f0d1ca8ca66aa9712b02ff055c3e1b00739ef8 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -1153,8 +1153,8 @@ virDomainNumaGetNodeDistance(virDomainNumaPtr numa, * defined default for local and remote nodes. */ if (!distances || - !distances[cellid].value || - !numa->mem_nodes[node].ndistances) + cellid >= numa->nmem_nodes || + !distances[cellid].value) return (node == cellid) ? LOCAL_DISTANCE : REMOTE_DISTANCE; return distances[cellid].value;