mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Do not crash if the prompt command name are binger that 260char or the command line.
svn path=/trunk/; revision=17806
This commit is contained in:
parent
4b1a13ae2f
commit
f586d22df5
3 changed files with 7 additions and 7 deletions
|
@ -295,7 +295,7 @@ static BOOL RunFile(LPTSTR filename)
|
|||
static VOID
|
||||
Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest)
|
||||
{
|
||||
TCHAR szFullName[MAX_PATH];
|
||||
TCHAR szFullName[CMDLINE_LENGTH];
|
||||
TCHAR *first = NULL;
|
||||
TCHAR *rest = NULL;
|
||||
TCHAR *full = NULL;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
INT cmd_start (LPTSTR First, LPTSTR Rest)
|
||||
{
|
||||
TCHAR szFullName[MAX_PATH];
|
||||
TCHAR szFullName[CMDLINE_LENGTH];
|
||||
TCHAR first[CMDLINE_LENGTH];
|
||||
TCHAR *rest = NULL;
|
||||
TCHAR *param = NULL;
|
||||
|
@ -117,12 +117,12 @@ INT cmd_start (LPTSTR First, LPTSTR Rest)
|
|||
|
||||
if (!_tcscmp (first + 1, _T(":")) && _istalpha (*first))
|
||||
{
|
||||
TCHAR szPath[MAX_PATH];
|
||||
TCHAR szPath[CMDLINE_LENGTH];
|
||||
|
||||
_tcscpy (szPath, _T("A:"));
|
||||
szPath[0] = _totupper (*first);
|
||||
SetCurrentDirectory (szPath);
|
||||
GetCurrentDirectory (MAX_PATH, szPath);
|
||||
GetCurrentDirectory (CMDLINE_LENGTH, szPath);
|
||||
if (szPath[0] != (TCHAR)_totupper (*first))
|
||||
ConErrResPuts (STRING_FREE_ERROR1);
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
BOOL
|
||||
SearchForExecutableSingle (LPCTSTR pFileName, LPTSTR pFullName, LPTSTR pExtension)
|
||||
{
|
||||
TCHAR szPathBuffer[MAX_PATH];
|
||||
TCHAR szPathBuffer[CMDLINE_LENGTH];
|
||||
LPTSTR pszBuffer = NULL;
|
||||
DWORD dwBuffer, len;
|
||||
LPTSTR s,f;
|
||||
|
@ -106,7 +106,7 @@ SearchForExecutableSingle (LPCTSTR pFileName, LPTSTR pFullName, LPTSTR pExtensio
|
|||
#endif
|
||||
|
||||
if (GetFullPathName (pFileName,
|
||||
MAX_PATH,
|
||||
CMDLINE_LENGTH,
|
||||
szPathBuffer,
|
||||
&pFilePart) ==0)
|
||||
return FALSE;
|
||||
|
@ -129,7 +129,7 @@ SearchForExecutableSingle (LPCTSTR pFileName, LPTSTR pFullName, LPTSTR pExtensio
|
|||
}
|
||||
|
||||
/* search in current directory */
|
||||
len = GetCurrentDirectory (MAX_PATH, szPathBuffer);
|
||||
len = GetCurrentDirectory (CMDLINE_LENGTH, szPathBuffer);
|
||||
if (szPathBuffer[len - 1] != _T('\\'))
|
||||
{
|
||||
szPathBuffer[len] = _T('\\');
|
||||
|
|
Loading…
Reference in a new issue