mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
Fixed the allocation of the buffer for the environment variable in ProcessInput.
svn path=/trunk/; revision=16557
This commit is contained in:
parent
7a0a377edd
commit
537bcb48fa
1 changed files with 6 additions and 5 deletions
|
@ -1061,18 +1061,19 @@ ProcessInput (BOOL bFlag)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
evar = malloc ( size * sizeof(TCHAR));
|
evar = malloc ( 512 * sizeof(TCHAR));
|
||||||
if (evar==NULL)
|
if (evar==NULL)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
size = GetEnvironmentVariable (ip, evar, size);
|
size = GetEnvironmentVariable (ip, evar, 512);
|
||||||
if (size!=0)
|
if (size > 512)
|
||||||
{
|
{
|
||||||
evar = realloc(evar,size * sizeof(TCHAR) );
|
evar = realloc(evar,size * sizeof(TCHAR) );
|
||||||
if (evar!=NULL)
|
if (evar==NULL)
|
||||||
{
|
{
|
||||||
size = GetEnvironmentVariable (ip, evar, size);
|
return 1;
|
||||||
}
|
}
|
||||||
|
size = GetEnvironmentVariable (ip, evar, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size)
|
if (size)
|
||||||
|
|
Loading…
Reference in a new issue