Commit 9ae103f7 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Respect string length returned from ISAXAttributes.

parent d0413fd4
......@@ -782,7 +782,7 @@ static HRESULT WINAPI mxwriter_saxcontent_startElement(
for (i = 0; i < length; i++)
{
const WCHAR *str;
INT len;
INT len = 0;
hr = ISAXAttributes_getQName(attr, i, &str, &len);
if (FAILED(hr)) return hr;
......@@ -790,16 +790,17 @@ static HRESULT WINAPI mxwriter_saxcontent_startElement(
/* space separator in front of every attribute */
xmlOutputBufferWriteString(This->buffer, " ");
s = xmlchar_from_wchar(str);
s = xmlchar_from_wcharn(str, len);
xmlOutputBufferWriteString(This->buffer, (char*)s);
heap_free(s);
xmlOutputBufferWriteString(This->buffer, "=\"");
len = 0;
hr = ISAXAttributes_getValue(attr, i, &str, &len);
if (FAILED(hr)) return hr;
s = xmlchar_from_wchar(str);
s = xmlchar_from_wcharn(str, len);
xmlOutputBufferWriteString(This->buffer, (char*)s);
heap_free(s);
......
......@@ -567,13 +567,13 @@ static HRESULT WINAPI isaxattributes_getQName(
const WCHAR **pQName,
int *pQNameLength)
{
static const WCHAR attr1W[] = {'a',':','a','t','t','r','1',0};
static const WCHAR attr2W[] = {'a','t','t','r','2',0};
static const WCHAR attr1W[] = {'a',':','a','t','t','r','1','j','u','n','k',0};
static const WCHAR attr2W[] = {'a','t','t','r','2','j','u','n','k',0};
ok(nIndex == 0 || nIndex == 1, "invalid index received %d\n", nIndex);
*pQName = (nIndex == 0) ? attr1W : attr2W;
*pQNameLength = lstrlenW(*pQName);
*pQNameLength = (nIndex == 0) ? 7 : 5;
return S_OK;
}
......@@ -654,13 +654,13 @@ static HRESULT WINAPI isaxattributes_getValue(
const WCHAR ** pValue,
int * nValue)
{
static const WCHAR attrval1W[] = {'a','1',0};
static const WCHAR attrval2W[] = {'a','2',0};
static const WCHAR attrval1W[] = {'a','1','j','u','n','k',0};
static const WCHAR attrval2W[] = {'a','2','j','u','n','k',0};
ok(nIndex == 0 || nIndex == 1, "invalid index received %d\n", nIndex);
*pValue = (nIndex == 0) ? attrval1W : attrval2W;
*nValue = lstrlenW(*pValue);
*nValue = 2;
return S_OK;
}
......
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