Fix handle allocator (#8970)

Use the right type for the index to prevent the value from being
truncated.
This commit is contained in:
Sungun Park
2025-07-18 18:07:05 +00:00
committed by GitHub
parent f499103ac8
commit 8636f11d73

View File

@@ -204,7 +204,7 @@ public:
} else {
// check for heap handle use-after-free
if (UTILS_UNLIKELY(!mUseAfterFreeCheckDisabled)) {
uint8_t const index = (handle.getId() & HANDLE_INDEX_MASK);
HandleBase::HandleId const index = (handle.getId() & HANDLE_INDEX_MASK);
// if we've already handed out this handle index before, it's definitely a
// use-after-free, otherwise it's probably just a corrupted handle
if (index < mId) {