mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 07:26:47 +00:00
fix a buffer overflow
svn path=/trunk/; revision=31901
This commit is contained in:
parent
0fa9a1e144
commit
afb39ce8fa
|
@ -262,7 +262,10 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
|
||||||
/* Then we are transferring to another batch */
|
/* Then we are transferring to another batch */
|
||||||
CloseHandle (bc->hBatchFile);
|
CloseHandle (bc->hBatchFile);
|
||||||
bc->hBatchFile = INVALID_HANDLE_VALUE;
|
bc->hBatchFile = INVALID_HANDLE_VALUE;
|
||||||
|
if (bc->params)
|
||||||
cmd_free (bc->params);
|
cmd_free (bc->params);
|
||||||
|
if (bc->raw_params)
|
||||||
|
cmd_free (bc->raw_params);
|
||||||
}
|
}
|
||||||
|
|
||||||
bc->hBatchFile = hFile;
|
bc->hBatchFile = hFile;
|
||||||
|
@ -280,7 +283,7 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
|
||||||
bc->raw_params = (TCHAR*) cmd_alloc((_tcslen(param)+1) * sizeof(TCHAR));
|
bc->raw_params = (TCHAR*) cmd_alloc((_tcslen(param)+1) * sizeof(TCHAR));
|
||||||
if (bc->raw_params != NULL)
|
if (bc->raw_params != NULL)
|
||||||
{
|
{
|
||||||
memset (bc->raw_params, 0, _tcslen(bc->raw_params) * sizeof(TCHAR));
|
memset (bc->raw_params, 0, (_tcslen(param)+1) * sizeof(TCHAR));
|
||||||
_tcscpy(bc->raw_params,param);
|
_tcscpy(bc->raw_params,param);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue