kernel: handle: handle_table_transfer now ignores items with KERN_HANDLE_INVALID

This commit is contained in:
2026-03-12 20:41:01 +00:00
parent 2fb8f556b4
commit 5a37b5e148

View File

@@ -232,6 +232,10 @@ kern_status_t handle_table_transfer(
break; break;
} }
if (src_handle.hnd_value == KERN_HANDLE_INVALID) {
continue;
}
struct handle *src_entry struct handle *src_entry
= handle_table_get_handle(src, src_handle.hnd_value); = handle_table_get_handle(src, src_handle.hnd_value);
struct handle *dst_entry = NULL; struct handle *dst_entry = NULL;
@@ -239,7 +243,7 @@ kern_status_t handle_table_transfer(
if (!src_entry) { if (!src_entry) {
status = KERN_INVALID_ARGUMENT; status = KERN_INVALID_ARGUMENT;
src_handle.hnd_result = KERN_OK; src_handle.hnd_result = KERN_INVALID_ARGUMENT;
vm_region_write_kernel( vm_region_write_kernel(
src_region, src_region,
src_handle_addr, src_handle_addr,