mirror of
https://github.com/reactos/reactos.git
synced 2024-08-04 10:30:59 +00:00
[KERNEL32]
- Fix buffer overrun - Fix incorrect return check CID #514675 CID #716130 CID #731615 svn path=/trunk/; revision=62657
This commit is contained in:
parent
cfbaed3a33
commit
c7548b6c43
|
@ -301,10 +301,12 @@ WINAPI
|
|||
GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize)
|
||||
{
|
||||
BOOL ret;
|
||||
|
||||
ret = GetComputerNameExA(ComputerNameNetBIOS, lpBuffer, lpnSize);
|
||||
if(!ret && GetLastError() == ERROR_MORE_DATA)
|
||||
SetLastError(ERROR_BUFFER_OVERFLOW);
|
||||
return ret;
|
||||
if (!ret && GetLastError() == ERROR_MORE_DATA)
|
||||
SetLastError(ERROR_BUFFER_OVERFLOW);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -325,7 +325,7 @@ CopyFileExA(IN LPCSTR lpExistingFileName,
|
|||
PUNICODE_STRING lpExistingFileNameW;
|
||||
|
||||
lpExistingFileNameW = Basep8BitStringToStaticUnicodeString(lpExistingFileName);
|
||||
if (!lpExistingFileName)
|
||||
if (!lpExistingFileNameW)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ BaseGetVdmConfigInfo(IN LPCWSTR CommandLineReserved,
|
|||
* %s%c : Nothing if DOS VDM, -w if WoW VDM, -ws if separate WoW VDM.
|
||||
*/
|
||||
_snwprintf(CommandLine,
|
||||
sizeof(CommandLine),
|
||||
sizeof(CommandLine) / sizeof(CommandLine[0]),
|
||||
L"\"%s\\ntvdm.exe\" -i%lx %s%c",
|
||||
Buffer,
|
||||
DosSeqId,
|
||||
|
@ -246,7 +246,7 @@ BaseGetVdmConfigInfo(IN LPCWSTR CommandLineReserved,
|
|||
* %s%c : Nothing if DOS VDM, -w if WoW VDM, -ws if separate WoW VDM.
|
||||
*/
|
||||
_snwprintf(CommandLine,
|
||||
sizeof(CommandLine),
|
||||
sizeof(CommandLine) / sizeof(CommandLine[0]),
|
||||
L"\"%s\\ntvdm.exe\" %s%c",
|
||||
Buffer,
|
||||
(BinaryType == BINARY_TYPE_DOS) ? L" " : L"-w",
|
||||
|
|
Loading…
Reference in a new issue