[PATCH 2/2] oleaut32: Fix null terminator for return string at SysReAllocStringLen

Alexander Kochetkov al.kochet at gmail.com
Tue Oct 13 11:28:55 CDT 2009


see bug 20334
-------------- next part --------------
From ee797390ba9b833ad77be0e88ce10146f8c0407e Mon Sep 17 00:00:00 2001
From: Alexander Kochetkov <al.kochet at gmail.com>
Date: Tue, 13 Oct 2009 20:12:29 +0400
Subject: [PATCH 2/2] oleaut32: Fix null terminator for return string at SysReAllocStringLen
To: wine-patches <wine-patches at winehq.org>
Reply-To: wine-devel <wine-devel at winehq.org>

---
 dlls/oleaut32/oleaut.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c
index 896d6d4..6886c7b 100644
--- a/dlls/oleaut32/oleaut.c
+++ b/dlls/oleaut32/oleaut.c
@@ -306,6 +306,11 @@ int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* str, unsigned int len)
 	 * when 'in' is NULL!
 	 * Some Microsoft program needs it.
 	 */
+	 
+	/* Another hidden feature: XP, 98 always return string with
+	 * null terminator.
+	 */
+        (*old)[len] = 0;
       }
     } else {
       /*
-- 
1.6.0.4


More information about the wine-patches mailing list