mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 18:26:04 +00:00
[rtl]
- len returned from mbstowcs is the required size of the destination string, so only allocate the needed size. - When doing the actual conversion pass in the size of the ansi string not the needed size of destination. - These changes were missed in 47527. svn path=/trunk/; revision=47529
This commit is contained in:
parent
f6d5918b31
commit
be344838ef
1 changed files with 3 additions and 3 deletions
|
@ -1578,6 +1578,7 @@ static NTSTATUS parse_manifest( struct actctx_loader* acl, struct assembly_ident
|
||||||
{
|
{
|
||||||
/* let's assume utf-8 for now */
|
/* let's assume utf-8 for now */
|
||||||
int len;
|
int len;
|
||||||
|
WCHAR *new_buff;
|
||||||
|
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
|
@ -1591,17 +1592,16 @@ static NTSTATUS parse_manifest( struct actctx_loader* acl, struct assembly_ident
|
||||||
_SEH2_END;
|
_SEH2_END;
|
||||||
|
|
||||||
DPRINT("len = %x\n", len);
|
DPRINT("len = %x\n", len);
|
||||||
WCHAR *new_buff;
|
|
||||||
|
|
||||||
if (len == -1)
|
if (len == -1)
|
||||||
{
|
{
|
||||||
DPRINT1( "utf-8 conversion failed\n" );
|
DPRINT1( "utf-8 conversion failed\n" );
|
||||||
return STATUS_SXS_CANT_GEN_ACTCTX;
|
return STATUS_SXS_CANT_GEN_ACTCTX;
|
||||||
}
|
}
|
||||||
if (!(new_buff = RtlAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(WCHAR) )))
|
if (!(new_buff = RtlAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY, len)))
|
||||||
return STATUS_NO_MEMORY;
|
return STATUS_NO_MEMORY;
|
||||||
|
|
||||||
mbstowcs( new_buff, buffer, len);
|
mbstowcs( new_buff, buffer, size);
|
||||||
xmlbuf.ptr = new_buff;
|
xmlbuf.ptr = new_buff;
|
||||||
DPRINT("Buffer %S\n", new_buff);
|
DPRINT("Buffer %S\n", new_buff);
|
||||||
xmlbuf.end = xmlbuf.ptr + len;
|
xmlbuf.end = xmlbuf.ptr + len;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue