forked from OSchip/llvm-project
[trace][intelpt] Fix out-of-bounds access.
The StringRef single argument constructor expects a null-terminated string. Explicitly pass the size to prevent reading pass the end of the array.
This commit is contained in:
parent
c4e5a24dd6
commit
3dd00461f9
|
@ -60,8 +60,8 @@ lldb_private::process_linux::GetAvailableLogicalCoreIDs() {
|
|||
if (!cpuinfo)
|
||||
return cpuinfo.takeError();
|
||||
|
||||
Expected<std::vector<int>> core_ids = GetAvailableLogicalCoreIDs(
|
||||
StringRef(reinterpret_cast<const char *>(cpuinfo->data())));
|
||||
Expected<std::vector<int>> core_ids = GetAvailableLogicalCoreIDs(StringRef(
|
||||
reinterpret_cast<const char *>(cpuinfo->data()), cpuinfo->size()));
|
||||
if (!core_ids)
|
||||
return core_ids.takeError();
|
||||
|
||||
|
|
Loading…
Reference in New Issue