Explorar o código

Fix out-of-bound access into _policies

Samuel Thibault %!s(int64=11) %!d(string=hai) anos
pai
achega
a33ed4bf6d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      mpi/src/starpu_mpi_select_node.c

+ 1 - 1
mpi/src/starpu_mpi_select_node.c

@@ -61,7 +61,7 @@ int starpu_mpi_node_selection_register_policy(starpu_mpi_select_node_policy_func
 		if (_policies[i] == NULL) break;
 		i++;
 	}
-	STARPU_ASSERT_MSG(_policies[i] == NULL, "No unused policy available. Unregister existing policies before registering a new one.");
+	STARPU_ASSERT_MSG(i<_STARPU_MPI_NODE_SELECTION_MAX_POLICY, "No unused policy available. Unregister existing policies before registering a new one.");
 	_policies[i] = policy_func;
 	return i;
 }