Skip to content

Commit 3344cb0

Browse files
wenduwanamirshehataornl
authored andcommitted
opal/common/ofi: bugfix to string lengths
Adjust string lengths according to the uuid format Signed-off-by: Wenduo Wang <wenduwan@amazon.com> (cherry picked from commit 2b282c1)
1 parent 21feacc commit 3344cb0

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
@@ -634,14 +634,14 @@ static bool is_near(pmix_device_distance_t *distances,
634634
continue;
635635

636636
for (i = 0; i < num_distances; i++) {
637-
char lsguid[256], lnguid[256];
637+
char lsguid[20], lnguid[20];
638638
int ret;
639639

640640
if (!distances[i].osname || !osdev->name
641641
|| strcmp(distances[i].osname, osdev->name))
642642
continue;
643643

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

0 commit comments

Comments
 (0)