mshtml: Alloc proper BSTR size in return_nscstr.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-03-27 18:53:01 +01:00 committed by Alexandre Julliard
parent 46de3fcf1d
commit 9f4d05b11c
2 changed files with 2 additions and 1 deletions

View File

@ -29,6 +29,7 @@ function test_xhr() {
next_test();
}
var onload_func = xhr.onload = function() {
ok(xhr.statusText === "OK", "statusText = " + xhr.statusText);
if(complete_cnt++)
next_test();
};

View File

@ -80,7 +80,7 @@ static HRESULT return_nscstr(nsresult nsres, nsACString *nscstr, BSTR *p)
if(*str) {
len = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0);
*p = SysAllocStringLen(NULL, len);
*p = SysAllocStringLen(NULL, len - 1);
if(!*p) {
nsACString_Finish(nscstr);
return E_OUTOFMEMORY;