[PATCH 0/1] MR2268: oleaut32: Allocate a full pointer when unmarshalling byref arrays.
Instead of the 4 bytes array wire size returned by get_type_size, which will truncate the pointer on 64-bit. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54562 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2268
From: Rémi Bernon <rbernon(a)codeweavers.com> Instead of the 4 bytes array wire size returned by get_type_size, which will truncate the pointer on 64-bit. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54562 --- dlls/oleaut32/usrmarshal.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/oleaut32/usrmarshal.c b/dlls/oleaut32/usrmarshal.c index aa54a2b092b..7f6b70638ac 100644 --- a/dlls/oleaut32/usrmarshal.c +++ b/dlls/oleaut32/usrmarshal.c @@ -506,7 +506,10 @@ unsigned char * WINAPI VARIANT_UserUnmarshal(ULONG *pFlags, unsigned char *Buffe ULONG mem_size; Pos += 4; - switch (header->vt & ~VT_BYREF) + /* byref array needs to allocate a LPSAFEARRAY pointer */ + if (header->vt & VT_ARRAY) + mem_size = sizeof(void *); + else switch (header->vt & ~VT_BYREF) { /* these types have a different memory size compared to wire size */ case VT_UNKNOWN: -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2268
Could we perhaps add a test for this? See test_marshal_VARIANT(). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2268#note_25382
participants (2)
-
Huw Davies (@huw) -
Rémi Bernon