Commit c94e646f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Fixed invalid use of -1 length in WideCharToMultiByte calls.

parent 4a46a019
...@@ -559,7 +559,6 @@ static HRESULT exec_fontname(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, ...@@ -559,7 +559,6 @@ static HRESULT exec_fontname(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
if(in) { if(in) {
char *stra; char *stra;
DWORD len;
if(V_VT(in) != VT_BSTR) { if(V_VT(in) != VT_BSTR) {
FIXME("Unsupported vt=%d\n", V_VT(out)); FIXME("Unsupported vt=%d\n", V_VT(out));
...@@ -568,12 +567,8 @@ static HRESULT exec_fontname(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, ...@@ -568,12 +567,8 @@ static HRESULT exec_fontname(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
TRACE("%s\n", debugstr_w(V_BSTR(in))); TRACE("%s\n", debugstr_w(V_BSTR(in)));
len = WideCharToMultiByte(CP_ACP, 0, V_BSTR(in), -1, NULL, 0, NULL, NULL); stra = heap_strdupWtoA(V_BSTR(in));
stra = heap_alloc(len);
WideCharToMultiByte(CP_ACP, 0, V_BSTR(in), -1, stra, -1, NULL, NULL);
set_ns_fontname(This->nscontainer, stra); set_ns_fontname(This->nscontainer, stra);
heap_free(stra); heap_free(stra);
update_doc(This, UPDATE_UI); update_doc(This, UPDATE_UI);
......
...@@ -135,7 +135,7 @@ static BOOL install_cab(LPCWSTR file_name) ...@@ -135,7 +135,7 @@ static BOOL install_cab(LPCWSTR file_name)
char install_dir[MAX_PATH]; char install_dir[MAX_PATH];
HRESULT (WINAPI *pExtractFilesA)(LPCSTR,LPCSTR,DWORD,LPCSTR,LPVOID,DWORD); HRESULT (WINAPI *pExtractFilesA)(LPCSTR,LPCSTR,DWORD,LPCSTR,LPVOID,DWORD);
LPSTR file_name_a; LPSTR file_name_a;
DWORD res, len; DWORD res;
HRESULT hres; HRESULT hres;
static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0}; static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0};
...@@ -160,11 +160,8 @@ static BOOL install_cab(LPCWSTR file_name) ...@@ -160,11 +160,8 @@ static BOOL install_cab(LPCWSTR file_name)
advpack = LoadLibraryW(wszAdvpack); advpack = LoadLibraryW(wszAdvpack);
pExtractFilesA = (void *)GetProcAddress(advpack, "ExtractFiles"); pExtractFilesA = (void *)GetProcAddress(advpack, "ExtractFiles");
len = WideCharToMultiByte(CP_ACP, 0, file_name, -1, NULL, 0, NULL, NULL);
file_name_a = heap_alloc(len);
WideCharToMultiByte(CP_ACP, 0, file_name, -1, file_name_a, -1, NULL, NULL);
/* FIXME: Use unicode version (not yet implemented) */ /* FIXME: Use unicode version (not yet implemented) */
file_name_a = heap_strdupWtoA(file_name);
hres = pExtractFilesA(file_name_a, install_dir, 0, NULL, NULL, 0); hres = pExtractFilesA(file_name_a, install_dir, 0, NULL, NULL, 0);
FreeLibrary(advpack); FreeLibrary(advpack);
heap_free(file_name_a); heap_free(file_name_a);
......
...@@ -134,7 +134,7 @@ static nsIInputStream *get_post_data_stream(IBindCtx *bctx) ...@@ -134,7 +134,7 @@ static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
data = heap_alloc(headers_len+post_len+sizeof(content_length)+8); data = heap_alloc(headers_len+post_len+sizeof(content_length)+8);
if(headers_len) { if(headers_len) {
WideCharToMultiByte(CP_ACP, 0, headers, -1, data, -1, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, headers, -1, data, headers_len, NULL, NULL);
len = fix_headers(data, post_len); len = fix_headers(data, post_len);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment