From 9be5380d4086d60c3cf017f9ace97e490710dcf3 Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Mon, 2 Dec 2024 12:32:50 +0000 Subject: [PATCH] SWDEV-500201 - UUID deduction logic ends up accessing empty map/nullptr on Phoenix2 APU as it finds GFX-XX which is ignored in logic. Change-Id: Ieed60dc4665d2b87ea994834457b026a3f58cb49 --- catch/unit/device/hipDeviceGetUuid.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/catch/unit/device/hipDeviceGetUuid.cc b/catch/unit/device/hipDeviceGetUuid.cc index a2e5963918..c42a2ae749 100644 --- a/catch/unit/device/hipDeviceGetUuid.cc +++ b/catch/unit/device/hipDeviceGetUuid.cc @@ -459,10 +459,12 @@ void ChkUUID() { #else uuid_map = getUUIDlistWithoutRocmInfo(); #endif - std::string uuid = uuid_map[0].data(); - std::string t_uuid = uuid.substr(4, 19); - if (memcmp(d_uuid.bytes, t_uuid.c_str(), 16) == 0) { - REQUIRE(true); + if (!uuid_map.empty()) { + std::string uuid = uuid_map[0].data(); + std::string t_uuid = uuid.substr(4, 19); + if (memcmp(d_uuid.bytes, t_uuid.c_str(), 16) == 0) { + REQUIRE(true); + } } }