[staging] onetbb: fix nullptr deref in hwloc probe (#565075)

This commit is contained in:
Martin Weinelt
2026-09-20 01:46:14 +00:00
committed by GitHub
2 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
diff --git a/src/tbbbind/tbb_bind.cpp b/src/tbbbind/tbb_bind.cpp
index 26fa6747..2adccea5 100644
--- a/src/tbbbind/tbb_bind.cpp
+++ b/src/tbbbind/tbb_bind.cpp
@@ -268,7 +268,9 @@ private:
// this function calls the interface that is available in the HWLOC 2.5 only.
#if HWLOC_API_VERSION >= 0x20500
auto some_core = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_CORE, nullptr);
- hwloc_get_obj_with_same_locality(topology, some_core, HWLOC_OBJ_CORE, nullptr, nullptr, 0);
+ if (some_core) {
+ hwloc_get_obj_with_same_locality(topology, some_core, HWLOC_OBJ_CORE, nullptr, nullptr, 0);
+ }
#endif
}

View File

@@ -44,6 +44,9 @@ stdenv.mkDerivation (finalAttrs: {
#
# <https://github.com/uxlfoundation/oneTBB/pull/1849>
./fix-libtbbmalloc-dlopen.patch
# <https://github.com/uxlfoundation/oneTBB/pull/2194>
./fix-hwloc-nullptr-deref.patch
];
nativeBuildInputs = [