Fix relibc netdb/lookup: use-after-move and unsafe block errors

Upstream relibc netdb DNS lookup has two bugs exposed by Rust 2024 edition
strict unsafe handling:

1. packet_data is moved into Box::via into_boxed_slice() but the retry
   loop tries to call packet_data.as_ptr() on the moved value. Use the
   already-created raw pointer packet_data_ptr instead.

2. close() is a safe function in relibc, so wrapping it in unsafe{}
   triggers unused-unsafe (promoted to error by -D unused-unsafe). Remove
   the unnecessary unsafe blocks around close() calls.

Patch carries in local/patches/relibc/P3-netdb-lookup-retry-fix.patch and
is applied via the relibc recipe patches list.
This commit is contained in:
2026-04-25 12:28:37 +01:00
parent f665929d96
commit 843f30ba42
2 changed files with 93 additions and 0 deletions
+1
View File
@@ -14,6 +14,7 @@ patches = [
"../../../local/patches/relibc/P3-ifaddrs-net_if.patch",
"../../../local/patches/relibc/P3-fd-event-tests.patch",
"../../../local/patches/relibc/P3-eventfd-mod.patch",
"../../../local/patches/relibc/P3-netdb-lookup-retry-fix.patch",
]
[build]