[PATCH] urlmon: Fixed target buffer length to MBtoWC

Marcus Meissner marcus at jet.franken.de
Wed Feb 4 14:15:04 CST 2009


Hi,

targetbuffer length must not be -1.

Ciao, Marcus
---
 dlls/urlmon/umon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c
index 521cfc2..bbaed5b 100644
--- a/dlls/urlmon/umon.c
+++ b/dlls/urlmon/umon.c
@@ -1185,7 +1185,7 @@ HRESULT WINAPI URLDownloadToCacheFileA(LPUNKNOWN lpUnkCaller, LPCSTR szURL, LPST
     if(szURL) {
         len = MultiByteToWideChar(CP_ACP, 0, szURL, -1, NULL, 0);
         url = heap_alloc(len*sizeof(WCHAR));
-        MultiByteToWideChar(CP_ACP, 0, szURL, -1, url, -1);
+        MultiByteToWideChar(CP_ACP, 0, szURL, -1, url, len);
     }
 
     if(szFileName)
-- 
1.5.6



More information about the wine-patches mailing list