Prohibit an empty name in RtlSetEnvironmentVariable

svn path=/trunk/; revision=35671
This commit is contained in:
Jeffrey Morlan 2008-08-26 14:45:37 +00:00
parent 7e88d259cb
commit a9431cc596

View file

@ -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));