oleaut32: Fix invalid memory access on 64-bit when warn+heap is used.

Sebastian Lackner sebastian at fds-team.de
Fri Jan 22 00:03:08 CST 2016


Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---

Introduced by 36f454cda0dc1fd5fbd1521ad8d1883be6995375.

 dlls/oleaut32/oleaut.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c
index 00e6daf..93c5fd3 100644
--- a/dlls/oleaut32/oleaut.c
+++ b/dlls/oleaut32/oleaut.c
@@ -309,7 +309,7 @@ void WINAPI SysFreeString(BSTR str)
             cache_entry->cnt++;
 
             if(WARN_ON(heap)) {
-                unsigned n = bstr_alloc_size(bstr->size) / sizeof(DWORD) - 1;
+                unsigned n = (alloc_size-FIELD_OFFSET(bstr_t, u.ptr))/sizeof(DWORD);
                 for(i=0; i<n; i++)
                     bstr->u.dwptr[i] = ARENA_FREE_FILLER;
             }
-- 
2.6.4



More information about the wine-patches mailing list