Skip to content

Commit 2b282c1

Browse files
committed
opal/common/ofi: bugfix to string lengths
Adjust string lengths according to the uuid format Signed-off-by: Wenduo Wang <wenduwan@amazon.com>
1 parent 09fd7a1 commit 2b282c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

opal/mca/common/ofi/common_ofi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,14 +645,14 @@ static bool is_near(pmix_device_distance_t *distances,
645645
continue;
646646

647647
for (i = 0; i < num_distances; i++) {
648-
char lsguid[256], lnguid[256];
648+
char lsguid[20], lnguid[20];
649649
int ret;
650650

651651
if (!distances[i].osname || !osdev->name
652652
|| strcmp(distances[i].osname, osdev->name))
653653
continue;
654654

655-
ret = sscanf(distances[i].uuid, "fab://%256s::%256s", lnguid, lsguid);
655+
ret = sscanf(distances[i].uuid, "fab://%19s::%19s", lnguid, lsguid);
656656
if (ret != 2)
657657
continue;
658658
if (nguid && (0 == strcasecmp(lnguid, nguid))) {

0 commit comments

Comments
 (0)