Skip to content

Commit 1a26508

Browse files
authored
[UR][Offload] Fix string length issue when getting device name (#19196)
1 parent 8fab234 commit 1a26508

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

unified-runtime/source/adapters/offload/program.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urProgramCreateWithBinary(
8989
size_t DevNameLength;
9090
OL_RETURN_ON_ERR(olGetDeviceInfoSize(phDevices[0]->OffloadDevice,
9191
OL_DEVICE_INFO_NAME, &DevNameLength));
92-
DevName.resize(DevNameLength);
92+
DevName.resize(DevNameLength - 1);
9393
OL_RETURN_ON_ERR(olGetDeviceInfo(phDevices[0]->OffloadDevice,
9494
OL_DEVICE_INFO_NAME, DevNameLength,
9595
DevName.data()));

0 commit comments

Comments
 (0)