[USETUP]
[reactos.git] / reactos / base / setup / usetup / cabinet.c
index 0f7b0ef..25357a4 100644 (file)
@@ -890,7 +890,7 @@ CabinetExtractFile(PCAB_SEARCH Search)
 
     RtlInitAnsiString(&AnsiString, Search->File->FileName);
     wcscpy(DestName, DestPath);
 
     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);
     UnicodeString.Buffer = DestName + wcslen(DestName);
     UnicodeString.Length = 0;
     RtlAnsiStringToUnicodeString(&UnicodeString, &AnsiString, FALSE);