mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 07:52:56 +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
3 changed files with 8 additions and 6 deletions
|
@ -301,10 +301,12 @@ WINAPI
|
||||||
GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize)
|
GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize)
|
||||||
{
|
{
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
ret = GetComputerNameExA(ComputerNameNetBIOS, lpBuffer, lpnSize);
|
ret = GetComputerNameExA(ComputerNameNetBIOS, lpBuffer, lpnSize);
|
||||||
if(!ret && GetLastError() == ERROR_MORE_DATA)
|
if (!ret && GetLastError() == ERROR_MORE_DATA)
|
||||||
SetLastError(ERROR_BUFFER_OVERFLOW);
|
SetLastError(ERROR_BUFFER_OVERFLOW);
|
||||||
return ret;
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -325,7 +325,7 @@ CopyFileExA(IN LPCSTR lpExistingFileName,
|
||||||
PUNICODE_STRING lpExistingFileNameW;
|
PUNICODE_STRING lpExistingFileNameW;
|
||||||
|
|
||||||
lpExistingFileNameW = Basep8BitStringToStaticUnicodeString(lpExistingFileName);
|
lpExistingFileNameW = Basep8BitStringToStaticUnicodeString(lpExistingFileName);
|
||||||
if (!lpExistingFileName)
|
if (!lpExistingFileNameW)
|
||||||
{
|
{
|
||||||
return FALSE;
|
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.
|
* %s%c : Nothing if DOS VDM, -w if WoW VDM, -ws if separate WoW VDM.
|
||||||
*/
|
*/
|
||||||
_snwprintf(CommandLine,
|
_snwprintf(CommandLine,
|
||||||
sizeof(CommandLine),
|
sizeof(CommandLine) / sizeof(CommandLine[0]),
|
||||||
L"\"%s\\ntvdm.exe\" -i%lx %s%c",
|
L"\"%s\\ntvdm.exe\" -i%lx %s%c",
|
||||||
Buffer,
|
Buffer,
|
||||||
DosSeqId,
|
DosSeqId,
|
||||||
|
@ -246,7 +246,7 @@ BaseGetVdmConfigInfo(IN LPCWSTR CommandLineReserved,
|
||||||
* %s%c : Nothing if DOS VDM, -w if WoW VDM, -ws if separate WoW VDM.
|
* %s%c : Nothing if DOS VDM, -w if WoW VDM, -ws if separate WoW VDM.
|
||||||
*/
|
*/
|
||||||
_snwprintf(CommandLine,
|
_snwprintf(CommandLine,
|
||||||
sizeof(CommandLine),
|
sizeof(CommandLine) / sizeof(CommandLine[0]),
|
||||||
L"\"%s\\ntvdm.exe\" %s%c",
|
L"\"%s\\ntvdm.exe\" %s%c",
|
||||||
Buffer,
|
Buffer,
|
||||||
(BinaryType == BINARY_TYPE_DOS) ? L" " : L"-w",
|
(BinaryType == BINARY_TYPE_DOS) ? L" " : L"-w",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue