From d439847ba67f84096775f3fa019361a640101c08 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Fri, 29 Oct 2021 09:17:56 +0200 Subject: [PATCH] Fix NSData initWithBytesNoCopy:length:deallocator: The previous implementation simply swizzled `NSData` into `NSDataWithDeallocatorBlock`, and forgot to actually assign `bytes` and `length`. --- Source/NSData.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/NSData.m b/Source/NSData.m index a6973ebf6..c5bf2017f 100644 --- a/Source/NSData.m +++ b/Source/NSData.m @@ -3548,6 +3548,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) } GSClassSwizzle(self, dataBlock); + bytes = buf; + length = len; ASSIGN(deallocator, (id)deallocBlock); return self; }