Skip to content

Commit 76321a9

Browse files
RossBruntonaarongreig
authored andcommitted
Fix string length issue when getting device name (#19196)
1 parent 0d85ac1 commit 76321a9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)