From f34e425e1a2be61db3983a452a39bb0a69f24485 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 10 Jan 2023 11:50:18 +0200 Subject: [PATCH] [WINESYNC] msvcrt: Don't fail when _aligned_offset_malloc is used with size=0. wine commit id 7771552f247660acc472b4862f32c4f8426be180 by Piotr Caban --- sdk/lib/crt/wine/heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/lib/crt/wine/heap.c b/sdk/lib/crt/wine/heap.c index 6a49988c63b..8fc3f6c37f1 100644 --- a/sdk/lib/crt/wine/heap.c +++ b/sdk/lib/crt/wine/heap.c @@ -545,7 +545,7 @@ void * CDECL _aligned_offset_malloc(MSVCRT_size_t size, MSVCRT_size_t alignment, } /* offset must be less than size */ - if (offset >= size) + if (offset && offset >= size) { *MSVCRT__errno() = MSVCRT_EINVAL; return NULL;