Skip to content

Commit 02bc8a8

Browse files
committed
hwloc_distrib(): error out if 0 is given
Thanks to Stephan Dollberg for the report. Closes #680 Signed-off-by: Brice Goglin <[email protected]>
1 parent 752c12f commit 02bc8a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/hwloc/helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ hwloc_distrib(hwloc_topology_t topology,
968968
unsigned given, givenweight;
969969
hwloc_cpuset_t *cpusetp = set;
970970

971-
if (flags & ~HWLOC_DISTRIB_FLAG_REVERSE) {
971+
if (!n || (flags & ~HWLOC_DISTRIB_FLAG_REVERSE)) {
972972
errno = EINVAL;
973973
return -1;
974974
}

0 commit comments

Comments
 (0)