mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 01:42:30 +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 */
|
||||
CloseHandle (bc->hBatchFile);
|
||||
bc->hBatchFile = INVALID_HANDLE_VALUE;
|
||||
cmd_free (bc->params);
|
||||
if (bc->params)
|
||||
cmd_free (bc->params);
|
||||
if (bc->raw_params)
|
||||
cmd_free (bc->raw_params);
|
||||
}
|
||||
|
||||
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));
|
||||
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);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue