mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
GetTempPathW should write an empty string to the buffer in case it wasn't large enough
svn path=/trunk/; revision=13354
This commit is contained in:
parent
919a5257b4
commit
87e189fd31
1 changed files with 4 additions and 1 deletions
|
@ -308,7 +308,7 @@ GetTempPathW (
|
||||||
if (nBufferLength < Value->Length / sizeof(WCHAR) + 2)
|
if (nBufferLength < Value->Length / sizeof(WCHAR) + 2)
|
||||||
Length++;
|
Length++;
|
||||||
|
|
||||||
if (lpBuffer != NULL)
|
if (nBufferLength >= Value->Length /sizeof(WCHAR) + 1)
|
||||||
{
|
{
|
||||||
if (nBufferLength < Value->Length / sizeof(WCHAR) + 2)
|
if (nBufferLength < Value->Length / sizeof(WCHAR) + 2)
|
||||||
{
|
{
|
||||||
|
@ -324,6 +324,9 @@ GetTempPathW (
|
||||||
lpBuffer[Value->Length / sizeof(WCHAR)] = L'\\';
|
lpBuffer[Value->Length / sizeof(WCHAR)] = L'\\';
|
||||||
lpBuffer[Value->Length / sizeof(WCHAR) + 1] = 0;
|
lpBuffer[Value->Length / sizeof(WCHAR) + 1] = 0;
|
||||||
}
|
}
|
||||||
|
} else if (nBufferLength > 0)
|
||||||
|
{
|
||||||
|
lpBuffer[0] = L'\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
return Length;
|
return Length;
|
||||||
|
|
Loading…
Reference in a new issue