Author: jmorlan
Date: Tue Aug 26 09:45:37 2008
New Revision: 35671
URL:
http://svn.reactos.org/svn/reactos?rev=35671&view=rev
Log:
Prohibit an empty name in RtlSetEnvironmentVariable
Modified:
trunk/reactos/lib/rtl/env.c
Modified: trunk/reactos/lib/rtl/env.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/env.c?rev=35671&am…
==============================================================================
--- trunk/reactos/lib/rtl/env.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/env.c [iso-8859-1] Tue Aug 26 09:45:37 2008
@@ -282,6 +282,10 @@
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));