From: Martin Kletzander Date: Thu, 6 Nov 2014 11:17:10 +0000 (+0100) Subject: numa: fix assumption in virNumaNodeIsAvailable() X-Git-Tag: CVE-2014-8135~229 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=877a222449c3f6779936447a6d9d606f7f2892c9;p=thirdparty%2Flibvirt.git numa: fix assumption in virNumaNodeIsAvailable() When compiled without full numa support, the stub function for virNumaNodeIsAvailable() just checks whether specified node is in range <0, max); where max is maximum NUMA node available on the host. But because the maximum node number is the highest usabe number (and not the count of nodes), the check is incorrect as it should check whether the specified node is in range <0, max> instead. Signed-off-by: Martin Kletzander --- diff --git a/src/util/virnuma.c b/src/util/virnuma.c index 20f1e564b2..06520f78eb 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -460,7 +460,7 @@ virNumaNodeIsAvailable(int node) return false; /* Do we have anything better? */ - return (node >= 0) && (node < max_node); + return (node >= 0) && (node <= max_node); }