jrandolf opened PR #14869 from jrandolf:c-api-null-name to bytecodealliance:main:
Several functions in the component C API passed a name pointer and length straight to
std::slice::from_raw_parts. That's UB for a null pointer even when the length is zero, which is exactly what the C++ API passes for a defaultstd::string_view, and debug builds abort with "unsafe precondition(s) violated". There were 10 of these: the component and instance type lookups, the five linkeradd_*functions, and the twoget_export_indexfunctions. They now use the existingslice_from_raw_partshelper, like the rest of the C API.The new tests only crash without the fix in a debug build, which is what CI uses.
jrandolf has marked PR #14869 as ready for review.
jrandolf removed the review request for wasmtime-core-reviewers from PR #14869.
jrandolf requested wasmtime-core-reviewers for a review on PR #14869.
jrandolf requested dicej for a review on PR #14869.
github-actions[bot] added the label wasmtime:c-api on PR #14869.
:thumbs_up: alexcrichton submitted PR review.
:speech_balloon: alexcrichton created PR review comment:
Can this test use the C++ API rather than the C API, at least for the bulk of the skeleton?
alexcrichton removed the review request for dicej from PR #14869.
:memo: jrandolf submitted PR review.
:speech_balloon: jrandolf created PR review comment:
Done
jrandolf updated PR #14869.
jrandolf requested alexcrichton for a review on PR #14869.
:thumbs_up: alexcrichton submitted PR review.
alexcrichton added PR #14869 Handle empty names in the component C API to the merge queue.
:check: alexcrichton merged PR #14869.
alexcrichton removed PR #14869 Handle empty names in the component C API from the merge queue.
Last updated: Oct 31 2026 at 23:03 UTC