Skip to content

Commit 32cc399

Browse files
committed
levelzero: fix a snprintf overflow warning
Signed-off-by: Brice Goglin <[email protected]>
1 parent 1beba70 commit 32cc399

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hwloc/topology-levelzero.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,8 +725,8 @@ hwloc_levelzero_discover(struct hwloc_backend *backend, struct hwloc_disc_status
725725
zeDeviceGetSubDevices(dvh[j], &nr_subdevices, subh);
726726
for(k=0; k<nr_subdevices; k++) {
727727
subosdevs[k] = hwloc_alloc_setup_object(topology, HWLOC_OBJ_OS_DEVICE, HWLOC_UNKNOWN_INDEX);
728-
snprintf(buffer, sizeof(buffer), "ze%u.%u", zeidx, k);
729-
subosdevs[k]->name = strdup(buffer);
728+
snprintf(tmp, sizeof(tmp), "ze%u.%u", zeidx, k);
729+
subosdevs[k]->name = strdup(tmp);
730730
subosdevs[k]->depth = HWLOC_TYPE_DEPTH_UNKNOWN;
731731
subosdevs[k]->attr->osdev.type = HWLOC_OBJ_OSDEV_COPROC;
732732
subosdevs[k]->subtype = strdup("LevelZero");

0 commit comments

Comments
 (0)