From 9c7e1e42e8fc59d6ccaa335a448da93edd929978 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Mon, 9 Jun 2025 22:18:15 +0100 Subject: [PATCH] string_pool.rs: Fix UB `from_raw_parts` requires the first `length` values to be initialized but here we're not initializing any (likely doesn't matter for u8) --- src/string_pool.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/string_pool.rs b/src/string_pool.rs index a275305..41b0e26 100644 --- a/src/string_pool.rs +++ b/src/string_pool.rs @@ -47,7 +47,7 @@ impl Drop for Chunk { // have a destructor. This means the len doesn't matter, only // the capacity. unsafe { - Vec::from_raw_parts(self.start, self.capacity, self.capacity); + Vec::from_raw_parts(self.start, 0, self.capacity); } } }