mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 12:29:56 +00:00
Prohibit an empty name in RtlSetEnvironmentVariable
svn path=/trunk/; revision=35671
This commit is contained in:
parent
7e88d259cb
commit
a9431cc596
1 changed files with 4 additions and 0 deletions
|
@ -282,6 +282,10 @@ RtlSetEnvironmentVariable(PWSTR *Environment,
|
|||
DPRINT("RtlSetEnvironmentVariable(Environment %p Name %wZ Value %wZ)\n",
|
||||
Environment, Name, Value);
|
||||
|
||||
/* Variable name must not be empty */
|
||||
if (Name->Length < sizeof(WCHAR))
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
||||
/* Variable names can't contain a '=' except as a first character. */
|
||||
for (wcs = Name->Buffer + 1;
|
||||
wcs < Name->Buffer + (Name->Length / sizeof(WCHAR));
|
||||
|
|
Loading…
Reference in a new issue