mirror of
https://github.com/reactos/reactos.git
synced 2024-09-08 19:59:49 +00:00
Bugfix environ so it does not allown = in environ name not even as frist char
svn path=/trunk/; revision=22073
This commit is contained in:
parent
ce582d62b8
commit
979f267d03
|
@ -222,6 +222,7 @@ int SetEnv(const wchar_t *option)
|
|||
|
||||
if (option == NULL || (epos = wcschr(option, L'=')) == NULL)
|
||||
return -1;
|
||||
|
||||
remove = (epos[1] == 0);
|
||||
|
||||
/* Duplicate environment if needed. */
|
||||
|
@ -244,6 +245,15 @@ int SetEnv(const wchar_t *option)
|
|||
memcpy(name, option, (epos - option) * sizeof(wchar_t));
|
||||
name[epos - option] = 0;
|
||||
|
||||
if (*name == 0) || (wcschr(option, L'=') !=NULL)
|
||||
{
|
||||
/* fixme check see if name contain any space or so
|
||||
so we really locate first char in name and compare
|
||||
it with equal
|
||||
*/
|
||||
free(name);
|
||||
return -1;
|
||||
}
|
||||
/* Find the option we're trying to modify. */
|
||||
for (index = 0, wenvptr = _wenviron; *wenvptr != NULL; wenvptr++, index++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue