mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 05:00:27 +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",
|
DPRINT("RtlSetEnvironmentVariable(Environment %p Name %wZ Value %wZ)\n",
|
||||||
Environment, Name, Value);
|
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. */
|
/* Variable names can't contain a '=' except as a first character. */
|
||||||
for (wcs = Name->Buffer + 1;
|
for (wcs = Name->Buffer + 1;
|
||||||
wcs < Name->Buffer + (Name->Length / sizeof(WCHAR));
|
wcs < Name->Buffer + (Name->Length / sizeof(WCHAR));
|
||||||
|
|
Loading…
Reference in a new issue