mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[USETUP]
Fix a really mean bug: wcslen() returns the size in characters whereas MaximumLength has to be in bytes. Now, this sets MaximumLength to its appropriate size and prevents some memory issues (and buffers having odd size, which is weird for an unicode string...). svn path=/trunk/; revision=50615
This commit is contained in:
parent
ff11a09b02
commit
dab840147a
1 changed files with 1 additions and 1 deletions
|
@ -890,7 +890,7 @@ CabinetExtractFile(PCAB_SEARCH Search)
|
|||
|
||||
RtlInitAnsiString(&AnsiString, Search->File->FileName);
|
||||
wcscpy(DestName, DestPath);
|
||||
UnicodeString.MaximumLength = sizeof(DestName) - wcslen(DestName);
|
||||
UnicodeString.MaximumLength = sizeof(DestName) - wcslen(DestName) * sizeof(WCHAR);
|
||||
UnicodeString.Buffer = DestName + wcslen(DestName);
|
||||
UnicodeString.Length = 0;
|
||||
RtlAnsiStringToUnicodeString(&UnicodeString, &AnsiString, FALSE);
|
||||
|
|
Loading…
Reference in a new issue